Skip to content

bam2emase error when reference is not defined "*" #1

Description

@dantaki

For reads like these:

NS500146:205:H2WC7BGX2:1:11101:6081:1104	141	*	0	0	*	*	0	0	GTGGAGAGATCCAGGGATGGGAATCTCAGGACAATTAACCTGGACCAGACTCCCACAGGGTTTCAAAAACAGTCCC	AAAAAEEEEEEEEEEEEEEEEEEEEEEEEEAEEEEEEEEEEEEEEEEEEEEEEEEEAEEEEEEEEEEEEEEEEEEE	XM:i:0

I get this error when running bam2emase

(gbrs) $ gbrs bam2emase -i test.bam -m R84-REL1505/ref.transcripts.info  -s A,B,C,D,E,F,G,H -o test.emase

Traceback (most recent call last):
  File "anaconda3/envs/gbrs/bin/gbrs", line 4, in <module>
    __import__('pkg_resources').run_script('gbrs==0.1.5', 'gbrs')
  File "anaconda3/envs/gbrs/lib/python2.7/site-packages/pkg_resources/__init__.py", line 664, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "anaconda3/envs/gbrs/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1444, in run_script
    exec(code, namespace, namespace)
  File "anaconda3/envs/gbrs/lib/python2.7/site-packages/gbrs-0.1.5-py2.7.egg-info/scripts/gbrs", line 199, in <module>
    sys.exit(main())
  File "anaconda3/envs/gbrs/lib/python2.7/site-packages/gbrs-0.1.5-py2.7.egg-info/scripts/gbrs", line 195, in main
    args.func(**kws)
  File "anaconda3/envs/gbrs/lib/python2.7/site-packages/gbrs/emase_utils.py", line 101, in bam2emase
    alignmat_factory.prepare(haplotypes, loci, outdir=os.path.dirname(outfile))
  File "anaconda3/envs/gbrs/lib/python2.7/site-packages/emase/AlignmentMatrixFactory.py", line 48, in prepare
    locus, hap = fh.getrname(aln.tid).split(delim)
AttributeError: 'NoneType' object has no attribute 'split'

I fixed the error by adding this line above line 48 in AlignmentMatrixFactory.py

                if aln.flag != 4 and aln.flag != 8:
                    if aln.tid==-1: continue
                    locus, hap = fh.getrname(aln.tid).split(delim)

These were the commands I used before on a small test case

$ bowtie -q -a --best --strata --sam -v 3 bowtie_ref/transcripts -1 fq/PB357_04_NPC-44200414_R1.fastq.gz -2 fq/PB357_04_NPC-44200414_R2.fastq.gz | samtools view -bS - > test.bam

$ gbrs bam2emase -i test.bam -m /oasis/projects/nsf/ddp195/dantakli/organoid/R84-REL1505/ref.transcripts.info -s 1,2,3,4,5,6,7,8 -o test.emase

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions