bsipos / uncle_psl

A BLAT (PSL) to SAM converter.
Mozilla Public License 2.0
7 stars 5 forks source link

NameError: global name 'sys' is not defined #3

Closed GabyBG closed 6 years ago

GabyBG commented 6 years ago

Hi, I was trying to add the sequence to the sam file using my fasta files, but I get an error. I already check that all paths are ok and actually I can see that It gives me a outputfile but with 2 sequences only. Is this problem related to the python version that I am using? I find it weird because it works if I don't add the fasta file...

Traceback (most recent call last): File "/data/users/gbalderr/uncle_psl/scripts/uncle_psl.py", line 40, in psl2sam.psl2sam(args.infile, args.outfile, reads, args.H, args.N) File "/data/users/gbalderr/anaconda2/lib/python2.7/site-packages/uncle_PSL/psl2sam.py", line 204, in psl2sam sam_rec = psl_rec2sam_rec(psl_fields, sam_writer, reads, soft_clip, n_limit) File "/data/users/gbalderr/anaconda2/lib/python2.7/site-packages/uncle_PSL/psl2sam.py", line 169, in psl_rec2sam_rec seq = reverse_complement(seq) File "/data/users/gbalderr/anaconda2/lib/python2.7/site-packages/uncle_PSL/seq_util.py", line 46, in reverse_complement return reduce(lambda x, y: x + y, map(base_complement, seq[::-1])) File "/data/users/gbalderr/anaconda2/lib/python2.7/site-packages/uncle_PSL/seq_util.py", line 31, in base_complement sys.stderr.write( NameError: global name 'sys' is not defined

Thank you so much for your help Gaby B.

bsipos commented 6 years ago

Hi,

This error was caused by a missing import, please pull the latest version and try again. It should work, however the error also indicates that you have unknown bases in the sequences for which the complement cannot be found.

Also, if you are using BLAT for spliced alignment you might want check out minimap2 which has SAM output without conversion.

Regards, Botond