Entering edit mode
7.0 years ago
simplitia
▴
130
Hi I'm trying to follow a work flow and I'm confused by instruction.
This is what the instruction says,
- Map reads with bwa as single end sequences then combine single reads into one file
How does one combine single reads into one file? What tried so far is this.
bwa mem -t 4 hg19 Kf_1.fq.gz > Kf_1.sam;
bwa mem -t 4 hg19 Kf_2.fq.gz > Kf_2.sam;
I then tried to combine the sam file with picard,
java -jar picard.jar MergeSamFiles I=Kf_1.sam I=Kf_2.sam O=/sc/snpir.out/KF.sam
but this does not work because I assume headers are completely the same for both files? I get this error here,
Cannot add sequence that already exists in SAMSequenceDictionary:
Does anyone have an idea how I can go about this? perhaps I'm not reading the instruction correctly??
thanks in advance!
As written this does not make sense. If you aligned SE reads separately then you would have to combine the alignment files (not reads) into one as you are trying to do. Is this a published protocol somewhere that you can link?
yes its weird I have a hard time following it; I think the authors meant merge alingments. its from a package here; https://github.com/rpiskol/SNPiR the instructions are on the bottom steps 3 and 4
This is an odd workflow, why you shouldn't map the pairs as pairs? Is this from some paper, some software?
I have the same question so I'm bit at odd but I'm sure the authors had a good reason. Its from a paper and here is the github: https://github.com/rpiskol/SNPiR
Try merging the .sam files with samtools:
And, if needed, convert bam to sam:
thanks this looks good. One worry I have is would the merge bam still contain duplicate header info? If that is the case other tools from picard like MarkDuplicates is going to crash with the same error.
I don't know, but if it does, try the suggestion from this SAMtools mail list message.
Thanks. This is going to be more complicated than I expected. I will try your method out first since its the most straightforward. I will post back here on an update.