This is a Python package for annoq-api-v2
Clone this repository
git clone https://github.com/USCbiostats/annoq-py.git
Install the package
pip install .
Open python on the terminal and import the package
python
>>> from src.annoq import annoq
To run the tests
python -m pytest test/test.py
GetSNPsByChromosome(self, chr, start, end, fields, filter=None, page_from=None, page_size=None)
Returns list of json
Scrolling is done if page is more than 10k
chr: str - Chromosome string
start: int - Start of chromosome
end: int - End of chromosome
fields: list[str] - List of strings with the fields that you
filter: list[str] (optional) - List of strings with fields that you want to filter on
page_from: int (optional) - Starting page number
page_size: int (optional) - Size of the page
annoq().get_SNPs_by_chromosome(chr="2", start=1, end=10000000, fields=['chr', 'ref', 'pos', 'rs_dbSNP151', 'ANNOVAR_ensembl_Effect', 'ANNOVAR_refseq_Effect'], query_type_option='SCROLL', filter=['chr'], page_from=2, page_size=4)
GetSNPsByGeneProduct(self, gene, fields, filter=None, page_from=None, page_size=None)
Returns list of json
Scrolling is done if page is more than 10k
gene: str - Gene product string
fields: list[str] - List of strings with the fields that you
filter: list[str] (optional) - List of strings with fields that you want to filter on
page_from: int (optional) - Starting page number
page_size: int (optional) - Size of the page
annoq().get_SNPs_by_gene_product(gene="Q9BVC4", fields=["chr", "id"], filter=["chr", "pos"], page_from=0, page_size=10)
GetSNPsByIDs(self, ids, fields, filter=None, page_from=None, page_size=None)
Returns list of json
Scrolling is done if page is more than 10k
ids: list[str] - List of IDs
fields: list[str] - List of strings with the fields that you
filter: list[str] (optional) - List of strings with fields that you want to filter on
page_from: int (optional) - Starting page number
page_size: int (optional) - Size of the page
annoq().get_SNPs_by_IDs(ids=["2:10632C>A", "16:2255492G>A"], fields=["id", "chr"], query_type_option='SNPS', filter=["chr"], page_from=0, page_size=5)
GetSNPsByRsID(self, rsID, fields, filter=None, page_from=None, page_size=None)
Returns list of json
Scrolling is done if page is more than 10k
rsID: str - rsID string
fields: list[str] - List of strings with the fields that you
filter: list[str] (optional) - List of strings with fields that you want to filter on
page_from: int (optional) - Starting page number
page_size: int (optional) - Size of the page
annoq().get_SNPs_by_RsID(rsID='rs189126619', fields=["rs_dbSNP151", "ref"], filter=["rs_dbSNP151"], page_from=0, page_size=2)
GetSNPsByRsIDs(self, rsIDs, fields, filter=None, page_from=None, page_size=None)
Returns list of json
Scrolling is done if page is more than 10k
rsIDs: list[str] - list of rsIDs
fields: list[str] - List of strings with the fields that you
filter: list[str] (optional)- List of strings with fields that you want to filter on
page_from: int (optional) - Starting page number
page_size: int (optional) - Size of the page
annoq().get_SNPs_by_RsIDs(rsIDs=['rs189126619', 'rs115366554'], fields=["rs_dbSNP151", "ref"], query_type_option='SNPS', filter=["rs_dbSNP151"], page_from=0, page_size=2)
count_SNPs_by_chromosome(self, chr, start, end, filter)
return int
chr: str - Chromosome string
start: int - Start of chromosome
end: int - End of chromosome
filter: list[str] (optional) - List of strings with fields that you want to filter on
annoq().count_SNPs_by_chromosome(chr="2", start=1, end=10000000, filter=["chr", "ANNOVAR_ensembl_Closest_gene(intergenic_only)"])
count_SNPs_by_gene_product(self, gene, filter)
return int
gene: str - Gene product string
filter: list[str] (optional) - List of strings with fields that you want to filter on
annoq().count_SNPs_by_gene_product(gene="Q9BVC4", filter=["chr", "pos"])
count_SNPs_by_IDs(self, ids, filter)
return int
ids: list[str] - List of IDs
filter: list[str] (optional) - List of strings with fields that you want to filter on
annoq().count_SNPs_by_IDs(ids=["2:10632C>A", "2:10632C>A"], filter=["chr"])
count_SNPs_by_RsID(self, rsID, filter)
return int
rsID: str - rsID string
filter: list[str] (optional) - List of strings with fields that you want to filter on
annoq().count_SNPs_by_RsID(rsID='rs189126619', filter=["rs_dbSNP151"])
count_SNPs_by_RsIDs(self, rsIDs, filter)
return int
rsIDs: list[str] - list of rsIDs
filter: list[str] (optional) - List of strings with fields that you want to filter on
annoq().count_SNPs_by_RsIDs(rsIDs=['rs189126619', 'rs115366554'], filter=["rs_dbSNP151"])