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:
asivache 2009-06-24 19:08:10 +00:00
parent d4f3ca1a10
commit 3cb6d7048e
1 changed files with 11 additions and 6 deletions

View File

@ -274,8 +274,10 @@ public class GenomicMap implements Iterable<Map.Entry<String, Collection<GenomeL
if ( gl.getContigIndex() != r.getReferenceIndex() )
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");
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:
deletionLength += (int)(refPos-currStop-1);
@ -322,13 +324,16 @@ public class GenomicMap implements Iterable<Map.Entry<String, Collection<GenomeL
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");
// add "deletion" w/respect to the master ref over the region between adjacent segments:
newCigar.add(new CigarElement((int)(refPos-currStop-1),CigarOperator.D));
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:
newCigar.add(new CigarElement((int)(refPos-currStop-1),CigarOperator.D));
}
currStop = gl.getStop();
// now we can continue with recording remaining matching bases over the current segment
}