blachlylab / fade

Fragmentase Artifact Detection and Elimination
MIT License
11 stars 3 forks source link

cannot index output file #14

Closed sinhaeti closed 3 years ago

sinhaeti commented 3 years ago

After running fade annotate, samtools sort, and fade out, I want to index the final bam file. However, I get an error from samtools index:

[E::hts_idx_push] Unsorted positions on sequence #5: 112160519 followed by 112160464
[E::sam_index] Read 'A00814:310:HVJ77DRXX:1:2101:1090:1219:TCAAAGCCA' with ref_name='5', ref_length=180915260, flags=163, pos=112160464 cannot be indexed
samtools index: failed to create index for [filename]

This is the read (output form samtools view):

A00814:310:HVJ77DRXX:1:2101:1090:1219:TCAAAGCCA 83  5   112160519   60  151M    =   112160464   -206    CTCCTTTTCTTTTACCCAAGTGTAAAATGGTGGAATTCCTTGAAGCTCTGCCCTAGGCTCTTTTCCTTTCTCTCTATGCTTCTGTTATAGTTTTTGTTTTTGTTTTCAAATTTACAGCTCAATTTGAGTTTTTTCCCTGAGTTTTAGACAC FFFFFFFFF,:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF:FFFFFFFFFFFFFFFFFFFFFFFF:FFFFFFFFFFFFFFFFFFF:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NM:i:0  MD:Z:151    MC:Z:15S106M30S AS:i:151    XS:i:23 rs:i:0

Thank you,

sinhaeti commented 3 years ago

Resolved. I need to use samtools sort again after all 3 steps without the -n flag.

charlesgregory commented 3 years ago

Thank you for your interest in our tool. I will update our documentation to avoid any confusion.