Re: TypeError: cannot concatenate 'str' and 'list' objects

122 views
Skip to first unread message

Jim Kaminski

unread,
Nov 13, 2017, 3:30:57 PM11/13/17
to YJ Kim, shortbred-users
Hi Younjung,

It looks like ShortBRED-Quantify is getting a list item instead of a string for the variable 'strFile'. Could you please send me the full command you entered? 

For example:

python shortbred_quantify.py --markers mytestmarkers.faa --wgs example/wgs.fna  --results exampleresults.txt --tmp example_quantify

Thanks,

Jim


On Mon, Nov 13, 2017 at 1:21 AM, YJ Kim <meto...@gmail.com> wrote:
Dear all,

May I ask why I get the following error?

Working on file 1 of 1
Tabulating results for each marker...
Traceback (most recent call last):
  File "/home/vagrant/.linuxbrew/Cellar/shortbred/0.9.3-dev-702e3ef/libexec/shortbred_quantify.py", line 588, in <module>
    dReadLength = float(args.iAvgReadBP), iWGSReads = iTotalReadCount, strCentCheck=args.strCentroids,dAlnLength=args.dAlnLength,strFile = strInputFile)
  File "/home/vagrant/.linuxbrew/Cellar/shortbred/0.9.3-dev-702e3ef/libexec/src/quantify_functions.py", line 580, in CalculateCounts
    sys.stderr.write("WARNING: 0 Reads found in file:" + strFile )
TypeError: cannot concatenate 'str' and 'list' objects

Best wishes,

Younjung

--
You received this message because you are subscribed to the Google Groups "shortbred-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shortbred-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Violetta Florova

unread,
Feb 22, 2018, 1:01:30 PM2/22/18
to shortbred-users
I've got the same Error 
I've run AZY.fastq (wgs of 1 bacteria genome) against ARB database. Interestingly, that the runs against WGS of microbiome samples (from HMP project) are successfull.
I may assume that the cause is the fastq file. (which I attach)

/projects/academic/mjbuck/Buck_Lab_Members/violetta/new_project/shortbred_quantify_test.py --markers ./ARBmarkers.faa
--wgs ./AZY.txtAZY.fastq --usearch /projects/academic/mjbuck/Buck_Lab_Members/violetta/new_project/src/usearch --results results_AZY.txt

 File "/projects/academic/mjbuck/Buck_Lab_Members/violetta/new_project/src/quantify_functions.py", line 580, in CalculateCounts
 sys.stderr.write("WARNING: 0 Reads found in file:" + strFile )
 TypeError: cannot concatenate 'str' and 'list' objects


To unsubscribe from this group and stop receiving emails from it, send an email to shortbred-use...@googlegroups.com.
AZY.txtAZY.fastq
Message has been deleted

Jim Kaminski

unread,
Feb 24, 2018, 6:37:34 PM2/24/18
to Violetta Florova, shortbred-users
Hi Violetta,

Thank you for your patience.

It looks like the issue is that the wgs file has a fastq extension, but is in the fasta format. ShortBRED crashes because it generates an empty fasta file when it tries to run a "fastq to fasta" conversion on this file. I renamed your wgs file to "AZY.fna" and was able to run it using the ShortBRED_CARD_2017 markers at https://bitbucket.org/biobakery/shortbred/downloads/

python ~/PythonProjects/ShortBRED_std/shortbred/shortbred_quantify.py --markers /home/jim/PythonProjects/ShortBRED_Test_Materials/ShortBRED_CARd_2017_markers.faa --wgs  /home/jim/PythonProjects/ShortBRED_Test_Materials/AZY.fna  --usearch /home/jim/shortbred_dependecies/usearch/usearch10.0.240_i86linux32  --results out.tsv

Best,

Jim



On Thu, Feb 22, 2018 at 10:07 AM, Violetta Florova <florova....@gmail.com> wrote:
I've got the same Error 
I've run AZY.fastq (wgs of 1 bacteria genome) against ARB database. Interestingly, that the runs against WGS of microbiome samples (from HMP project) are successfull.
I may assume that the cause is the fastq file. (which I attach)

/projects/academic/mjbuck/Buck_Lab_Members/violetta/new_project/shortbred_quantify_test.py --markers ./ARBmarkers.faa
--wgs ./AZY.txtAZY.fastq --usearch /projects/academic/mjbuck/Buck_Lab_Members/violetta/new_project/src/usearch --results results_AZY.txt

 File "/projects/academic/mjbuck/Buck_Lab_Members/violetta/new_project/src/quantify_functions.py", line 580, in CalculateCounts
 sys.stderr.write("WARNING: 0 Reads found in file:" + strFile )
 TypeError: cannot concatenate 'str' and 'list' objects


On Monday, November 13, 2017 at 3:30:57 PM UTC-5, Jim Kaminski wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to shortbred-use...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages