Coder Social home page Coder Social logo

Comments (9)

brentp avatar brentp commented on July 16, 2024

I am not sure. You were able to run bwameth.py index without problems?
Do other tools (fastqc, etc) run without problems on your fastq files?

from bwa-meth.

MSleeper1 avatar MSleeper1 commented on July 16, 2024

I am having the same error when converting the sam files generated by alignment with bwa-meth to bam files:

[W::sam_parse1] urecognized reference name; treated as unmapped

I tried two variations of the command to align a single-end read and convert sam to bam:

bwameth.py --threads 8 --reference ref_genome.fa sample.fastq > sample.sam samtools view -b -o sample.bam sample.sam
and
bwameth.py --reference ref_genome.fa sample.fastq -t 8 | samtools view -b - > sample.bam

I was able to run bwameth.py index without any issues. I have tried the above commands on a few different fastq files and I am currently double-checking my fastq files with fastqc for any issues.

The environment I am using had the following package versions installed:
bwa 0.7.17
bwa-mem2 2.2.1
bwameth 0.2.5
python 3.11.0
samtools 1.6
toolshed 0.4.6

Please let me know if you have any advice on how to troubleshoot this error message.

Thank you.

from bwa-meth.

haodongchen avatar haodongchen commented on July 16, 2024

One problem I noticed is bwameth.py puts nothing in the chrom column when the read is unmapped, while it should put an * there:
readname\t77\t\t0\t0\t*\t*\t0\t0\tGNAATCATGTGTCTTCTTATCTCTAAATCAGAATCCCGCCCAAACGAAACGATACGACAACGCCGCGAAACCTCGATTAACCTCAAATAACCAATCCCCCACCGATCCCCGCCGCCGAACCCCCCGCGCCAGCCCGCGCCCCGCGCGGCCG\t;#CCCCCCC;CCCCCCCCCCCCCCCCCCCCCCCCCC;CCCCCC-CCCCCCC;CCCCCCCCCCCCCCCCCCCCCCC;CC--CCC;CC;CCCC;C;C;;;CC-CC--C;-CC--C;-CC--C---;--C--C--;C--;---CC;CCC-----\tAS:i:0\tXS:i:0\tRG:Z:test\tYC:Z:CT\n. This may cause some software to report Unrecognized reference name.

from bwa-meth.

brentp avatar brentp commented on July 16, 2024

@haodongchen , thanks for diagnosing. I pushed a fix for this, would you or others in this issue give it a try and let me know?
thanks!

from bwa-meth.

MSleeper1 avatar MSleeper1 commented on July 16, 2024

@brentp, I can confirm that the blank chrom column is causing the issue because I did not get this error when I removed reads that were blank in the chrom column.

I pulled your most recent update and ran alignment with the updated bwameth.py.
bwameth.py --reference hg19.p13.plusMT.no_alt_analysis_set.fa.gz SRR536237.fastq > SRR536237.sam

The resulting sam file still contained blank chrom columns for some reads:

SRR536237.29	16	chr17	75537577	60	101M	*	0     	0ACTACCCCGAATAAACCACACTCCTTACAAAAACCAAACAACTACGTTAAAAAAATATTAATATTTATCAAAAAACCCTCTTCCAACCATTTTTAATTTTT	#########A>3><3<>A>=953>;;=?????>7;A@A@;?@;.<DDDDDEECCB@B<DDECECDB?16DDIEE??3A+3:FAIEE@>DDDDADDDD????	NM:i:1	MD:Z:76A24	AS:i:98XS:i:29	RG:Z:SRR536237	YC:Z:CT	YD:Z:r
SRR536237.30	4		0	0	*	*	0	0     	TTGTTGTTTGGAGATGTTTTGGTTTTGTGGTTTTAAGGCTTTGGAGAAGGGAGGGGAAAATATGTGTTTTTTTTTTGAATTAGGGTTATTAAAGTTAATTT	????8:ADD>?+2++2AEEDD<<C;FBEEI?8))*:*?*09DBB#########################################################	AS:i:0	XS:i:0	RG:Z:SRR536237	YC:Z:CT

When I ran samtools view -S -b SRR536237.sam > SRR536237.bam, it returned the same error.
[W::sam_parse1] urecognized reference name; treated as unmapped

Please let me know if any other information would be helpful.
Thank you.

from bwa-meth.

brentp avatar brentp commented on July 16, 2024

thanks for following up @MSleeper1 . Can you share a fastq with 2 reads that show the problem?
I think this is likely something with not having paired-end reads as there are likely few users with single-end reads.

from bwa-meth.

haodongchen avatar haodongchen commented on July 16, 2024

I tried the fix and it solved the problem I got.

from bwa-meth.

brentp avatar brentp commented on July 16, 2024

@MSleeper1 and @haodongchen thanks for following up! I'll tag a new release with the fix.

from bwa-meth.

MSleeper1 avatar MSleeper1 commented on July 16, 2024

I dug into which script was being used when I called bwameth.py and found that has been defaulting to using miniconda3/envs/bwa/bin/bwameth.py.

When I ran the alignment and specified the absolute path miniconda3/pkgs/bwameth-0.2.5-pyh5e36f6f_0/python-scripts/bwameth.py, which contains your most recent push. This solved my problem; there are now * in the chrom columns that were previously blank.

Thank you for all the help. :)

from bwa-meth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.