don't freak out if two reference intervals a custom contig is built of are strictly adjacent; instead politely warn user that her data suck and proceed
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1089 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
d4f3ca1a10
commit
3cb6d7048e
|
|
@ -274,8 +274,10 @@ public class GenomicMap implements Iterable<Map.Entry<String, Collection<GenomeL
|
||||||
if ( gl.getContigIndex() != r.getReferenceIndex() )
|
if ( gl.getContigIndex() != r.getReferenceIndex() )
|
||||||
throw new StingException("Contig "+oldRefName+" has segments on different master contigs: currently unsupported");
|
throw new StingException("Contig "+oldRefName+" has segments on different master contigs: currently unsupported");
|
||||||
|
|
||||||
if ( refPos <= currStop + 1 )
|
if ( refPos < currStop + 1 )
|
||||||
throw new StingException("Contig "+oldRefName+" has segments that are out of order or strictly adjacent: currently unsupported");
|
throw new StingException("Contig "+oldRefName+" has segments that are out of order or strictly adjacent: currently unsupported");
|
||||||
|
if ( refPos == currStop + 1 )
|
||||||
|
System.out.println("WARNING: Contig "+oldRefName+" has segments that are strictly adjacent");
|
||||||
|
|
||||||
// add "deletion" w/respect to the master ref over the region between adjacent segments:
|
// add "deletion" w/respect to the master ref over the region between adjacent segments:
|
||||||
deletionLength += (int)(refPos-currStop-1);
|
deletionLength += (int)(refPos-currStop-1);
|
||||||
|
|
@ -322,13 +324,16 @@ public class GenomicMap implements Iterable<Map.Entry<String, Collection<GenomeL
|
||||||
throw new StingException("Contig "+oldRefName+
|
throw new StingException("Contig "+oldRefName+
|
||||||
" has segments on different master contigs: currently unsupported");
|
" has segments on different master contigs: currently unsupported");
|
||||||
|
|
||||||
if ( refPos <= currStop + 1 )
|
if ( refPos < currStop + 1 )
|
||||||
throw new StingException("Contig "+oldRefName+
|
throw new StingException("Contig "+oldRefName+
|
||||||
" has segments that are out of order or strictly adjacent: currently unsupported");
|
" has segments that are out of order or strictly adjacent: currently unsupported");
|
||||||
|
if ( refPos == currStop + 1 ) {
|
||||||
|
System.out.println("WARNING: Contig "+oldRefName+
|
||||||
|
" has segments that are strictly adjacent");
|
||||||
|
} else {
|
||||||
// add "deletion" w/respect to the master ref over the region between adjacent segments:
|
// add "deletion" w/respect to the master ref over the region between adjacent segments:
|
||||||
newCigar.add(new CigarElement((int)(refPos-currStop-1),CigarOperator.D));
|
newCigar.add(new CigarElement((int)(refPos-currStop-1),CigarOperator.D));
|
||||||
|
}
|
||||||
currStop = gl.getStop();
|
currStop = gl.getStop();
|
||||||
// now we can continue with recording remaining matching bases over the current segment
|
// now we can continue with recording remaining matching bases over the current segment
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue