View Single Post
Old 06-13-2019, 07:33 AM   #225
bwubb
Member
 
Location: Philadelphia

Join Date: Jan 2012
Posts: 58
Default

Quote:
Originally Posted by GenoMax View Post
@bwbubb: Option for reformat.sh that you are looking for is "pairedonly=f Toss reads that are not mapped as proper pairs". Set pairedonly=t and process your BAM files.
EDIT:

Thank you @GenoMax. This actually does not work for for this case.

Code:
[bwubb@node061 disambres]$ reformat.sh pairedonly=t in=input.bam out=fix.bam
java -ea -Xmx200m -cp /home/bwubb/software/bbmap/current/ jgi.ReformatReads pairedonly=t in=input.bam out=fix.bam
Executing jgi.ReformatReads [pairedonly=t, in=input.bam, out=fix.bam]

Found samtools 1.9
Input is being processed as unpaired
Input:                          13726088 reads                  2041390865 bases
Output:                         12583399 reads (91.68%)         1880228501 bases (92.11%)

Time:                           349.142 seconds.
Reads Processed:      13726k    39.31k reads/sec
Bases Processed:       2041m    5.85m bases/sec

[bwubb@node061 disambres]$ samtools index fix.bam
[bwubb@node061 disambres]$ java -jar ~/software/picard/2.20.2/picard.jar ValidateSamFile I=fix.bam MODE=SUMMARY
INFO    2019-06-13 08:00:16     ValidateSamFile

...

## HISTOGRAM    java.lang.String
Error Type      Count
ERROR:MATE_NOT_FOUND    2

[Thu Jun 13 08:02:01 EDT 2019] picard.sam.ValidateSamFile done. Elapsed time: 1.74 minutes.
Runtime.totalMemory()=2075918336
To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp
Not sure how things work internally, but from my understanding the "problem" reads think they are paired.


I toiled with this more yesterday and I believe I can use reformat.sh to make an interleaved fastq file, and then use repair.sh to make read1.fq and read2.fq and take it back to alignment. All attempts at correcting the bam directly seem to fail. I have yet to have total success, which in my case would be passing picardtools ValidateSamFile.

I am aligning with bwa mem -M, having some other issue in the validation that maybe is unrelated or will be fixed with the right reformat/repair arguments.

Last edited by bwubb; 06-13-2019 at 07:36 AM.
bwubb is offline   Reply With Quote