-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RE: reads_to_ctg_map.py #34
Comments
Hi, Seems to be something wrong with the command passed to samtools. Please provide me with the command line you were using when calling |
Thanks! here is it reads_to_ctg_map.py --threads 2 |
theres is no back slash are the end of the last line. |
It seems that you're using an old version of that script. Because the lines in the bug report provided by python doesn't match the errors on the current script. I would suggest you to update the script, or preferably the whole repository if you intend to scaffold with BESST. Please let me know if mapping with the newest version of the script also returns an error. |
Just got a clone of BESST using git clone and rerun the script again but it produced the same error (see below.) earlier I was looking up this error online and I found a suggested solution at this link (pysam-developers/pysam#291). They say the error is due to the new output parameters of the samtools. I modified the pysam.sort line in the script accordingly (just added "-o" in the pysam.sort statement), but it didn't solve the problem. they the type of error was different though (see the second passage below.) Sort BAM...Traceback (most recent call last): pysam.utils.SamtoolsError: 'samtools returned with error 1: stdout=, stderr=[bam_sort] Use -T PREFIX / -o FILE to specify temporary and final output files\n\nUsage: samtools sort [options...] [in.bam]\n\nOptions:\n\n -l INT Set compression level, from 0 (uncompressed) to 9 (best)\n\n -m INT Set maximum memory per thread; suffix K/M/G recognized [768M]\n\n -n Sort by read name\n\n -o FILE Write final output to FILE rather than standard output\n\n -T PREFIX Write temporary files to PREFIX.nnnn.bam\n\n -@, --threads INT\n\n Set number of sorting and compression threads [1]\n\n --input-fmt-option OPT[=VAL]\n\n Specify a single input file format option in the form\n\n of OPTION or OPTION=VALUE\n\n -O, --output-fmt FORMAT[,OPT[=VAL]]...\n\n Specify output format (SAM, BAM, CRAM)\n\n --output-fmt-option OPT[=VAL]\n\n Specify a single output file format option in the form\n\n of OPTION or OPTION=VALUE\n\n --reference FILE\n\n Reference sequence FASTA FILE [null]\n'---error after modifying the script---- |
Great that you solved it, I will implement this fix. The new bug looks easy to solve, |
But mp6k75.bwa.bam dir is generated by the script during the run. I didn't make it. I think the script the need to be modified not to produce this folder!! |
this part: pysam.sort("-o", bwa_output + ".bam", output_path) |
I have the same issue, latest version of BESST.
Probably pysam v.0.9.0 has more changes. |
I also got similar problem using latest BESST script. My samtools was: Then I changed the problematic line on reads_to_ctg_map.py into: I tested on a small dataset and it ran fine. |
Hi,
the script "reads_to_ctg_map.py" fails at sam sort stage and give the following message"
Convert SAM to BAM... Done.
Time elapsed for SAM to BAM conversion: 0:03:52.958605
Sort BAM...Traceback (most recent call last):
File "/home/malabady/Programs/local/scaffolding-tools/BESST/scripts/reads_to_ctg_map.py", line 319, in
tmp_path, args.bwa_path, args.clear)
File "/home/malabady/Programs/local/scaffolding-tools/BESST/scripts/reads_to_ctg_map.py", line 186, in bwa_mem
pysam.sort(bwa_output + ".bam", output_path)
File "/usr/local/lib/python2.7/dist-packages/pysam/utils.py", line 65, in call
"\n".join(stderr)))
pysam.utils.SamtoolsError: 'samtools returned with error 1: stdout=, stderr=[bam_sort] Use -T PREFIX / -o FILE to specify temporary and final output files\n\nUsage: samtools sort [options...] [in.bam]\n\nOptions:\n\n -l INT Set compression level, from 0 (uncompressed) to 9 (best)\n\n -m INT Set maximum memory per thread; suffix K/M/G recognized [768M]\n\n -n Sort by read name\n\n -o FILE Write final output to FILE rather than standard output\n\n -T PREFIX Write temporary files to PREFIX.nnnn.bam\n\n -@, --threads INT\n\n Set number of sorting and compression threads [1]\n\n --input-fmt-option OPT[=VAL]\n\n Specify a single input file format option in the form\n\n of OPTION or OPTION=VALUE\n\n -O, --output-fmt FORMAT[,OPT[=VAL]]...\n\n Specify output format (SAM, BAM, CRAM)\n\n --output-fmt-option OPT[=VAL]\n\n Specify a single output file format option in the form\n\n of OPTION or OPTION=VALUE\n\n --reference FILE\n\n Reference sequence FASTA FILE [null]\n'
Any suggestions what is wrong?
Thanks
Magdy
The text was updated successfully, but these errors were encountered: