From: Alec W. <al...@br...> - 2012-06-26 14:41:31
|
Hi Davy, I believe you have more than one @SQ record with the same SN value "chr10". You should be able to see this easily by looking at the beginning of your SAM file. I'm not that familiar with how BWA creates its header. You might want to inquire on the BWA list if you can't figure out where this is coming from. -Alec On 6/26/12 9:40 AM, Davy wrote: > I'm trying to convert SAM files to BAM files with Picard. The command > I have been using is > java -Xmx4g -Djava.io.tmpdir=/tmp -jar ../programs/picard/SortSam.jar > SO=coordinate INPUT=1005-1.sam OUTPUT=1005-1.bam > VALIDATION_STRINGENCY=LENIENT CREATE_INDEX=true > > The sam files were generated by > bwa sampe -f 1005-1.sam -r > "@RG\tID:1005-1\tLB:1005-1\tSM:1005-1\tPL:ILLUMINA" hg19 > 1005-1_pe1.sai 1005-1_pe2.sai 1005-1_pe1.fastq 1005-1_pe2.fastq > > > > I get the following error: > Exception in thread "main" java.lang.IllegalArgumentException: Cannot > add sequence that already exists in SAMSequenceDictionary: chr10 > at > net.sf.samtools.SAMSequenceDictionary.setSequences(SAMSequenceDictionary.java:62) > at > net.sf.samtools.SAMSequenceDictionary.<init>(SAMSequenceDictionary.java:40) > at > net.sf.samtools.SAMTextHeaderCodec.decode(SAMTextHeaderCodec.java:106) > at > net.sf.samtools.SAMTextReader.readHeader(SAMTextReader.java:204) > at net.sf.samtools.SAMTextReader.<init>(SAMTextReader.java:81) > at net.sf.samtools.SAMTextReader.<init>(SAMTextReader.java:90) > at net.sf.samtools.SAMFileReader.init(SAMFileReader.java:528) > at net.sf.samtools.SAMFileReader.<init>(SAMFileReader.java:144) > at net.sf.samtools.SAMFileReader.<init>(SAMFileReader.java:114) > at net.sf.picard.sam.SortSam.doWork(SortSam.java:61) > at > net.sf.picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:177) > at > net.sf.picard.cmdline.CommandLineProgram.instanceMainWithExit(CommandLineProgram.java:119) > at net.sf.picard.sam.SortSam.main(SortSam.java:79) > > Any suggestions on what I am doing wrong? > > Cheers, > Davy > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > > _______________________________________________ > Samtools-help mailing list > Sam...@li... > https://lists.sourceforge.net/lists/listinfo/samtools-help |