Make sure to convert non-integer chromosomes (M,X,Y) back from their corresponding integer representations (0,23,24) when writing in .bed format
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3119 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
705b28e90d
commit
27fb6f7594
|
|
@ -1,4 +1,14 @@
|
|||
import math
|
||||
def chrFormat(chr):
|
||||
if ( chr == "chr0"):
|
||||
return "chrM"
|
||||
if ( chr == "chr23" ):
|
||||
return "chrX"
|
||||
if ( chr == "chr24" ):
|
||||
return "chrY"
|
||||
else:
|
||||
return chr
|
||||
|
||||
def chr2int(chr):
|
||||
try:
|
||||
chr = chr.split("chr")[1]
|
||||
|
|
@ -123,7 +133,7 @@ class Exon:
|
|||
return self.interval.size()
|
||||
|
||||
def getBedEntry(self):
|
||||
return "\t".join([self.interval.chromosome,str(self.interval.start),str(self.interval.stop),self.gene,self.id,str(self.getCoverageProportion())])
|
||||
return "\t".join([chrFormat(self.interval.chromosome),str(self.interval.start),str(self.interval.stop),self.gene,self.id,str(self.getCoverageProportion())])
|
||||
|
||||
def getCoverageProportion(self):
|
||||
if ( self.size() > 0 ):
|
||||
|
|
|
|||
Loading…
Reference in New Issue