error with the 'concat' script

23 views
Skip to first unread message

Jaber Abbaszadeh

unread,
Apr 26, 2020, 4:39:27 AM4/26/20
to BinSanity
Hi. 
I am going through the great tutorial you have provided about Building Phylogenetic Tree V.2 https://www.protocols.io/view/building-phylogenetic-tree-q2pdydn?step=6
Everything works perfectly until using the 'concat' scrip. First, the error was "inconsistent use of tabs and spaces in indentation" but iI fixed it in the Pycharm. I'll attach the fixed file. 
It seems that some indents are tab which is not consistent with other space indentations. 

But still, I have another error when I run this script in the tutorial: 

concat -f . -e .trimmed.aln --Prefix Dataset1 -o Dataset1.HugRibosomal.trimmed.concat.aln -N 8

Traceback (most recent call last):
  File "/home/jaber/.local/bin/concat", line 63, in <module>
    concat_alignments(args.inputDir,args.inputExtension,args.inputPrefix,args.inputOutFile,args.number)
  File "/home/jaber/.local/bin/concat", line 36, in concat_alignments
    record_dict = SeqIO.index(name+".tmp","fasta")
  File "/home/jaber/.local/lib/python3.6/site-packages/Bio/SeqIO/__init__.py", line 980, in index
    proxy_class(filename, format, alphabet), key_function, repr, "SeqRecord"
  File "/home/jaber/.local/lib/python3.6/site-packages/Bio/SeqIO/_index.py", line 197, in __init__
    SeqFileRandomAccess.__init__(self, filename, format, alphabet)
  File "/home/jaber/.local/lib/python3.6/site-packages/Bio/SeqIO/_index.py", line 46, in __init__
    self._handle = _open_for_random_access(filename)
  File "/home/jaber/.local/lib/python3.6/site-packages/Bio/File.py", line 134, in _open_for_random_access
    handle = open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'Dataset1_RpL24.trimmed.tmp'


 I don't know why some files have .tmp and some don't!
my folder is like this:
$ ls
Dataset1.HugRibosomal.trimmed.concat.aln  Dataset1_RpL22.trimmed.aln  Dataset1_RpL4.trimmed.tmp   Dataset1_RpS19.aln          HUG_RpL18.faa    unknown1.faa
Dataset1_RpL14.aln                        Dataset1_RpL22.trimmed.tmp  Dataset1_RpL5.aln           Dataset1_RpS19.faa          HUG_RpL22.faa    unknown1.fna
Dataset1_RpL14.faa                        Dataset1_RpL24.aln          Dataset1_RpL5.faa           Dataset1_RpS19.trimmed.aln  HUG_RpL24.faa    unknown1.ribomarkers.tbl
Dataset1_RpL14.trimmed.aln                Dataset1_RpL24.faa          Dataset1_RpL5.trimmed.aln   Dataset1_RpS19.trimmed.tmp  HUG_RpL2.faa     unknown2.faa
Dataset1_RpL15.aln                        Dataset1_RpL24.trimmed.aln  Dataset1_RpL5.trimmed.tmp   Dataset1_RpS3.aln           HUG_RpL3.faa     unknown2.fna
Dataset1_RpL15.faa                        Dataset1_RpL2.aln           Dataset1_RpL6.aln           Dataset1_RpS3.faa           HUG_RpL4.faa     unknown2.ribomarkers.tbl
Dataset1_RpL15.trimmed.aln                Dataset1_RpL2.faa           Dataset1_RpL6.faa           Dataset1_RpS3.trimmed.aln   HUG_RpL5.faa     unknown3.faa
Dataset1_RpL16.aln                        Dataset1_RpL2.trimmed.aln   Dataset1_RpL6.trimmed.aln   Dataset1_RpS3.trimmed.tmp   HUG_RpL6.faa     unknown3.fna
Dataset1_RpL16.faa                        Dataset1_RpL2.trimmed.tmp   Dataset1_RpL6.trimmed.tmp   Dataset1_RpS8.aln           HUG_RpS10.faa    unknown3.ribomarkers.tbl
Dataset1_RpL16.trimmed.aln                Dataset1_RpL3.aln           Dataset1_RpS10.aln          Dataset1_RpS8.faa           HUG_RpS17.faa    unknown4.faa
Dataset1_RpL16.trimmed.tmp                Dataset1_RpL3.faa           Dataset1_RpS10.faa          Dataset1_RpS8.trimmed.aln   HUG_RpS19.faa    unknown4.fna
Dataset1_RpL18.aln                        Dataset1_RpL3.trimmed.aln   Dataset1_RpS10.trimmed.aln  Dataset1_RpS8.trimmed.tmp   HUG_RpS3.faa     unknown4.ribomarkers.tbl
Dataset1_RpL18.faa                        Dataset1_RpL3.trimmed.tmp   Dataset1_RpS10.trimmed.tmp  hmmsearhc-log.txt           HUG_RpS8.faa     unknown5.faa
Dataset1_RpL18.trimmed.aln                Dataset1_RpL4.aln           Dataset1_RpS17.aln          HUG_RpL14.faa               markersearch.sh  unknown5.fna
Dataset1_RpL22.aln                        Dataset1_RpL4.faa           Dataset1_RpS17.faa          HUG_RpL15.faa               msatrim.sh       unknown5.ribomarkers.tbl
Dataset1_RpL22.faa                        Dataset1_RpL4.trimmed.aln   Dataset1_RpS17.trimmed.aln  HUG_RpL16.faa               muscleloop.sh

 As you can see .tmp file doesn't exist for highlighted files. 

I can't figure out the reason. I have updated my pip3, re-installed Binsanity.. and the same
concat

Elaina

unread,
Apr 30, 2020, 3:07:31 PM4/30/20
to BinSanity
Hello Jaber,

I have fixed the inconsistent use of tabs issue (A lot of my python2 scripts had this issue when I transitioned to python3 and I hadn't caught this one yet!).

In regards to the second error, I believe that was another python3 related transition issue. I updated the install on through the BinSanity github after making a couple minor modifications so try pulling down the new version and running the example and let me know if everything works for you.

-Elaina
Reply all
Reply to author
Forward
0 new messages