-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
132 additions
and
50 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import requests | ||
import re | ||
import pandas as pd | ||
|
||
def getTerms(): | ||
url = 'http://purl.obolibrary.org/obo/go.obo' | ||
r = requests.get(url, allow_redirects=True) | ||
|
||
terms_list = [] | ||
cols = {} | ||
for line in r.content.splitlines(): | ||
line = line.decode("utf-8") | ||
if re.search(r'^id: GO', line): | ||
if len(cols.keys()) == 3: | ||
terms_list.append([cols['Vocab'], cols['Term'], cols['Name']]) | ||
cols = {} | ||
m = re.search(r'^id: (GO:\d+)', line) | ||
cols['Term'] = m.group(1) | ||
if re.search(r'^name: ', line): | ||
m = re.search(r'^name: (.+)', line) | ||
cols['Name'] = m.group(1) | ||
if re.search(r'^namespace: ', line): | ||
m = re.search(r'^namespace: (.+)', line) | ||
cols['Vocab'] = 'GO' #m.group(1) | ||
terms = pd.DataFrame(terms_list, columns=['Vocab', 'Term', 'Name']) | ||
return terms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import requests | ||
import pandas as pd | ||
|
||
def getTerms(): | ||
url = 'http://ftp.ebi.ac.uk/pub/databases/interpro/entry.list' | ||
r = requests.get(url, allow_redirects=True) | ||
|
||
terms_list = [] | ||
in_header = True | ||
for line in r.content.splitlines(): | ||
if in_header: | ||
in_header = False | ||
continue | ||
cols = line.decode("utf-8").split("\t") | ||
terms_list.append(['IPR', cols[0], cols[2]]) | ||
terms = pd.DataFrame(terms_list, columns=['Vocab', 'Term', 'Name']) | ||
return terms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import requests | ||
import pandas as pd | ||
|
||
def getOrthologs(): | ||
""" | ||
""" | ||
url = 'http://rest.kegg.jp/list/ko' | ||
r = requests.get(url, allow_redirects=True) | ||
|
||
terms_list = [] | ||
for line in r.content.splitlines(): | ||
cols = line.decode("utf-8").split("\t") | ||
terms_list.append(['KEGG', cols[0], cols[1]]) | ||
terms = pd.DataFrame(terms_list, columns=['Vocab', 'Term', 'Name']) | ||
terms['Term'] = terms['Term'].str.replace(r'ko:','', regex=True) | ||
|
||
return terms | ||
|
||
def getPathways(): | ||
""" | ||
""" | ||
url = 'http://rest.kegg.jp/list/pathway' | ||
r = requests.get(url, allow_redirects=True) | ||
|
||
terms_list = [] | ||
for line in r.content.splitlines(): | ||
cols = line.decode("utf-8").split("\t") | ||
terms_list.append(['KEGG', cols[0], cols[1]]) | ||
terms = pd.DataFrame(terms_list, columns=['Vocab', 'Term', 'Name']) | ||
terms['Term'] = terms['Term'].str.replace(r'path:map','ko', regex=True) | ||
return terms | ||
|
||
def getModules(): | ||
""" | ||
""" | ||
url = 'http://rest.kegg.jp/list/md' | ||
r = requests.get(url, allow_redirects=True) | ||
|
||
terms_list = [] | ||
for line in r.content.splitlines(): | ||
cols = line.decode("utf-8").split("\t") | ||
terms_list.append(['KEGG', cols[0], cols[1]]) | ||
terms = pd.DataFrame(terms_list, columns=['Vocab', 'Term', 'Name']) | ||
terms['Term'] = terms['Term'].str.replace(r'md:','', regex=True) | ||
return terms | ||
|
||
def getTerms(): | ||
modules = getModules() | ||
orthologs = getOrthologs() | ||
pathways = getPathways() | ||
|
||
return pd.concat([pathways, orthologs, modules]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import requests | ||
import pandas as pd | ||
|
||
def getTerms(): | ||
return | ||
|
||
url = 'http://ftp.ebi.ac.uk/pub/databases/Pfam/current_release/Pfam-A.full.gz' | ||
r = requests.get(url, allow_redirects=True) | ||
|
||
terms_list = [] | ||
in_header = True | ||
for line in r.content.splitlines(): | ||
if in_header: | ||
in_header = False | ||
continue | ||
cols = line.decode("utf-8").split("\t") | ||
terms_list.append(['Pfam', cols[1], cols[4]]) | ||
terms = pd.DataFrame(terms_list, columns=['Vocab', 'Term', 'Name']) | ||
return terms |
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from .GO import getTerms as GO_getTerms | ||
from .KEGG import getTerms as KEGG_getTerms | ||
from .IPR import getTerms as IPR_getTerms | ||
import pandas as pd | ||
|
||
def getTerms(vocabs = []): | ||
""" | ||
""" | ||
terms = pd.DataFrame(columns=['Vocab', 'Term', 'Name']) | ||
if 'GO' in vocabs: | ||
terms = pd.concat([terms, GO_getTerms()]) | ||
if 'IPR' in vocabs: | ||
terms = pd.concat([terms, IPR_getTerms()]) | ||
if 'KEGG' in vocabs: | ||
terms = pd.concat([terms, KEGG_getTerms()]) | ||
return terms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ statsmodels | |
sklearn | ||
progressbar2 | ||
scipy | ||
requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
sklearn | ||
progressbar2 | ||
scipy | ||
requests | ||
""".split() | ||
|
||
setup( | ||
|