Skip to content

Commit

Permalink
Merge pull request #11 from rhshah/master
Browse files Browse the repository at this point in the history
Merge from Master
  • Loading branch information
rhshah authored Jul 13, 2017
2 parents 5c2d802 + 228260c commit ee30aec
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 36,915 deletions.
17 changes: 0 additions & 17 deletions .project

This file was deleted.

8 changes: 0 additions & 8 deletions .pydevproject

This file was deleted.

19 changes: 14 additions & 5 deletions iAnnotateSV/AnnotateEachBreakpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ def AnnotateEachBreakpoint(chromosome,position,strand,df,autoSelect):
geneStart = df.iloc[index]['geneStart']
geneEnd = df.iloc[index]['geneEnd']
if((geneStart <= position) and (geneEnd >= position)):
#print position,geneStart,geneEnd
transcriptIndex.append(index)
desc = None
intronnum = None
intronframe = None
#print transcriptIndex
if(transcriptIndex):
coordData = pd.DataFrame(index=np.asarray(transcriptIndex),columns=['c', 'd', 'e', 'd1', 'd2', 'e1', 'e2','f'])

Expand All @@ -46,22 +48,23 @@ def AnnotateEachBreakpoint(chromosome,position,strand,df,autoSelect):
d = df.iloc[tindex]['txStart'] - position
apList = [c,d,e,d1,d2,e1,e2,f]
coordData.loc[tindex,['c', 'd', 'e', 'd1', 'd2', 'e1', 'e2','f']] = apList
#print "In Promoter","c=",c,"d=",d,"e=",e,"e1=",e1,"e2=",e2,"d1=",d1,"d2=",d2,"f=",f
#print "In Promoter 1",position,df.iloc[tindex]['txStart'],"c=",c,"d=",d,"e=",e,"e1=",e1,"e2=",e2,"d1=",d1,"d2=",d2,"f=",f
continue
else:
c = None
d = None
if position > df.iloc[tindex]['txEnd']:
c = 5
d = position - df.iloc[tindex]['txStart']
d = position - df.iloc[tindex]['txEnd']
apList = [c,d,e,d1,d2,e1,e2,f]
#coordData.add(apList)
coordData.loc[tindex,['c', 'd', 'e', 'd1', 'd2', 'e1', 'e2','f']] = apList
#print "In Promoter","c=",c,"d=",d,"e=",e,"e1=",e1,"e2=",e2,"d1=",d1,"d2=",d2,"f=",f
#print "In Promoter 2","c=",c,"d=",d,"e=",e,"e1=",e1,"e2=",e2,"d1=",d1,"d2=",d2,"f=",f
continue
else:
c = None
d = None

#in UTR region ?
if(df.iloc[tindex]['strand'] == '+'):
if df.iloc[tindex]['cdsStart'] > position:
Expand All @@ -71,7 +74,10 @@ def AnnotateEachBreakpoint(chromosome,position,strand,df,autoSelect):
coordData.loc[tindex,['c', 'd', 'e', 'd1', 'd2', 'e1', 'e2','f']] = apList
#print "In 5'UTR","c=",c,"d=",d,"e=",e,"e1=",e1,"e2=",e2,"d1=",d1,"d2=",d2,"f=",f
continue
elif position > df.iloc[tindex]['cdsEnd']:
else:
c = None
d = None
if position > df.iloc[tindex]['cdsEnd']:
c = 3
d = position - df.iloc[tindex]['cdsStart']
apList = [c,d,e,d1,d2,e1,e2,f]
Expand All @@ -89,7 +95,10 @@ def AnnotateEachBreakpoint(chromosome,position,strand,df,autoSelect):
coordData.loc[tindex,['c', 'd', 'e', 'd1', 'd2', 'e1', 'e2','f']] = apList
#print "In 3'UTR","c=",c,"d=",d,"e=",e,"e1=",e1,"e2=",e2,"d1=",d1,"d2=",d2,"f=",f
continue
elif position > df.iloc[tindex]['cdsEnd']:
else:
c = None
d = None
if position > df.iloc[tindex]['cdsEnd']:
c = 4
d = position - df.iloc[tindex]['cdsStart']
apList = [c,d,e,d1,d2,e1,e2,f]
Expand Down
10 changes: 7 additions & 3 deletions iAnnotateSV/FindCanonicalTranscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,22 @@ def FindCT(geneList,transcriptList,siteList,zoneList,strandList,intronnumList,in
intronnum = None
intronframe = None
chkval = isinstance(geneList,list)
# print geneList,transcriptList
if(chkval):
cts = []
cts = None
minIndex = None
for gene in geneList:
#print gene
if gene in ctDict:
cts = ctDict[gene]
#print cts
cts = ctDict.get(gene)
break
if(cts):
if(len(cts) > 1 ):
minIndex = min(enumerate(zoneList), key=itemgetter(1))[0]
else:
#print "CTS",cts[0]
try:
#print "I am here", transcriptList.index(cts[0])
minIndex = transcriptList.index(cts[0])
except ValueError:
logging.warn("iAnnotateSV::FindCanonicalTranscript: The given canonical transcript does not cover the coordinates.")
Expand Down
Loading

0 comments on commit ee30aec

Please sign in to comment.