We've moved!
This site is now read-only. You can find our new documentation site and support forum for posting questions here.
Be sure to read our welcome blog!

Error ReorderSam

elenavigoritoelenavigorito cambridgeMember

I have downloaded HG00152.7.M_120219_3.bam from ArrayExpress.

I have validated it using:
java -jar /scratch/ev250/bin/picard/picard-2.8.2.jar ValidateSamFile \
I=$filestart.rehead.bam \
MODE=SUMMARY

No errors found

I then try to reorder it using:
java -jar /scratch/ev250/bin/picard/picard-2.8.2.jar ReorderSam \
R=$seED/human_g1k_v37.fasta \
I=$filestart.rehead.bam \
O=$filestart.new_order.bam

but get the error:
Exception in thread "main" java.lang.IllegalArgumentException: Invalid reference index -1
at htsjdk.samtools.QueryInterval.(QueryInterval.java:24)
at htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter.query(SamReader.java:528)
at picard.sam.ReorderSam.doWork(ReorderSam.java:124)
at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:205)
at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:94)
at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:104)

When I test the output file, $filestart.new_order.bam, with ValidateSamFile I got:

[Wed Mar 08 19:59:24 GMT 2017] picard.sam.ValidateSamFile INPUT=HG00152.new_order.bam MODE=SUMMARY MAX_OUTPUT=100 IGNORE_WARNINGS=false VALIDATE_INDEX=true INDEX_VALIDATION_STRINGENCY=EXHAUSTIVE IS_BISULFITE_SEQUENCED=false MAX_OPEN_TEMP_FILES=8000 VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false GA4GH_CLIENT_SECRETS=client_secrets.json
[Wed Mar 08 19:59:24 GMT 2017] Executing as [email protected] on Linux 2.6.32-573.38.1.el6.x86_64 amd64; Java HotSpot(TM) 64-Bit Server VM 1.8.0_45-b14; Picard version: 2.8.2-SNAPSHOT
INFO 2017-03-08 20:00:10 SamFileValidator Validated Read 10,000,000 records. Elapsed time: 00:00:45s. Time for last 10,000,000: 45s. Last read position: 1:193,045,558
INFO 2017-03-08 20:00:54 SamFileValidator Validated Read 20,000,000 records. Elapsed time: 00:01:29s. Time for last 10,000,000: 44s. Last read position: 3:42,257,765
INFO 2017-03-08 20:01:40 SamFileValidator Validated Read 30,000,000 records. Elapsed time: 00:02:15s. Time for last 10,000,000: 46s. Last read position: 5:110,528,022
INFO 2017-03-08 20:02:25 SamFileValidator Validated Read 40,000,000 records. Elapsed time: 00:03:00s. Time for last 10,000,000: 45s. Last read position: 7:5,566,874
INFO 2017-03-08 20:03:11 SamFileValidator Validated Read 50,000,000 records. Elapsed time: 00:03:46s. Time for last 10,000,000: 45s. Last read position: 9:95,083,990
INFO 2017-03-08 20:03:56 SamFileValidator Validated Read 60,000,000 records. Elapsed time: 00:04:31s. Time for last 10,000,000: 45s. Last read position: 11:74,457,139
INFO 2017-03-08 20:04:41 SamFileValidator Validated Read 70,000,000 records. Elapsed time: 00:05:16s. Time for last 10,000,000: 44s. Last read position: 14:21,679,999
INFO 2017-03-08 20:05:29 SamFileValidator Validated Read 80,000,000 records. Elapsed time: 00:06:04s. Time for last 10,000,000: 48s. Last read position: 16:33,963,428
INFO 2017-03-08 20:06:14 SamFileValidator Validated Read 90,000,000 records. Elapsed time: 00:06:49s. Time for last 10,000,000: 44s. Last read position: 19:649,709
INFO 2017-03-08 20:06:59 SamFileValidator Validated Read 100,000,000 records. Elapsed time: 00:07:34s. Time for last 10,000,000: 45s. Last read position: 21:38,462,612

HISTOGRAM java.lang.String
Error Type Count
ERROR:MATE_NOT_FOUND 63
ERROR:TRUNCATED_FILE 2
also, if I try to index it,
samtools index -b $filestart.new_order.bam
I get: [W::bam_hdr_read] EOF marker is absent. The input is probably truncated.
samtools index: "HG00152.new_order.bam" is corrupted or unsorted

No idea how these errors arise if the parent file was OK. any help most welcome, I am just starting using these tools....

Tagged:

Best Answer

Answers

  • elenavigoritoelenavigorito cambridgeMember

    Many thanks for your response. I am trying to use ASEReadCounter to then look for eQTL. When I run ASEReadCounter with my files I got the error that the bam file was in order 1,10... instead of 1,2... so that is what I tried to order with ReroderSam.

    Best wishes

  • EADGEADG KielMember ✭✭✭

    @elenavigorito You are welcome :)

    A little tip for future comments, you enclose your error-message / code blocks with three backticks ``` or three times tilde ~~~.
    Your Error-Message here !

    Your code here!
    

    It is easier to read and even looks nicer :)

    Best wished

    EADG

Sign In or Register to comment.