+ | RSID | Population | Gene | +Your genotype | Ref allele | Alt allele | Zygosity | +Weight | +
---|---|---|---|---|---|---|---|---|
+ | ${row['snp']} | ${row['population']} | +${row['gene']} | +${row['nucleotides']} | ${row['ref']} | ${row['alt']} | ${row['zegot']} | ${row['weight']} | +
diff --git a/logo.png b/logo.png new file mode 100644 index 0000000..c1bca56 Binary files /dev/null and b/logo.png differ diff --git a/longevity2reporter.md b/longevity2reporter.md new file mode 100644 index 0000000..d030ae1 --- /dev/null +++ b/longevity2reporter.md @@ -0,0 +1,10 @@ +# Longevity2 reporter (pre alpha version) display your genome analysis related to longevity and disease risks + +It consist now of 3 parts: +* Longevitymap report, show your longevity-related rsid and their influence. +* Cancer report, show cancer risks. +* Drug report, show how your genome influences drug effects. +* Coranary disease report, lists snps that influence on chanses to have coranary disease. +* Prs report, have poligenic risk scores. + +It deppends on annotators: dbsnp, clinvar, omim, ncbigene, pubmed, gnomad, vcfinfo. \ No newline at end of file diff --git a/longevity2reporter.py b/longevity2reporter.py new file mode 100644 index 0000000..77763e5 --- /dev/null +++ b/longevity2reporter.py @@ -0,0 +1,91 @@ +import json + +from cravat.cravat_report import CravatReport +import sys +import datetime +import re +import csv +import zipfile +from pathlib import Path +import sqlite3 +from mako.template import Template + +class Reporter(CravatReport): + + def __init__(self, args): + super().__init__(args) + self.savepath = args['savepath'] + + + async def run(self): + self.setup() + self.write_data() + self.end() + pass + + + def setup(self): + self.input_database_path = f'{self.savepath}_longevity.sqlite' + self.db_conn = sqlite3.connect(self.input_database_path) + self.db_cursor = self.db_conn.cursor() + outpath = f'{self.savepath}.longevity2.html' + self.outfile = open(outpath, 'w', encoding='utf-8') + cur_path = str(Path(__file__).parent) + self.template = Template(filename=str(Path(__file__).parent)+"/template.html") + + + def write_table(self, name, json_fields = [], sort_field = "", sort_revers = False): + try: + sort_sql = "" + if sort_field != "": + sort_sql = " ORDER BY " + sort_field + if sort_revers: + sort_sql = sort_sql+" DESC" + else: + sort_sql = sort_sql+" ASC" + + self.db_cursor.execute("SELECT * FROM "+name+sort_sql) + rows = self.db_cursor.fetchall() + res = [] + + for row in rows: + tmp = {} + for i, item in enumerate(self.db_cursor.description): + if item[0] in json_fields: + lst = json.loads(row[i]) + if len(lst) == 0: + tmp[item[0]] = "" + else: + tmp[item[0]] = lst[0] + else: + tmp[item[0]] = row[i] + res.append(tmp) + self.data[name] = res + except Exception as e: + print("Warning:", e) + + + def write_data(self): + # self.data = {"test1":[1,2,3], "test2":["aa", "bbb", "cccc"]} + self.data = {} + self.write_table("prs", [], "id", True) + self.write_table("longevitymap", ["conflicted_rows", "description"], "weight", False) + self.write_table("cancer", [], "id", True) + self.write_table("coronary", [], "weight", False) + self.write_table("drugs", [], "id", True) + + + def end(self): + self.outfile.write(self.template.render(data=self.data)) + self.outfile.close() + return Path(self.outfile.name).resolve() + + +### Don't edit anything below here ### +def main(): + reporter = Reporter(sys.argv) + reporter.run() + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/longevity2reporter.yml b/longevity2reporter.yml new file mode 100644 index 0000000..87bd7bc --- /dev/null +++ b/longevity2reporter.yml @@ -0,0 +1,32 @@ +title: Longevity2 +version: 0.3.0 +type: reporter +description: Create report with longevity ralated information (pre alpha version). It deppends on postagregators . +output_filename_schema: +- '{run_name}.longevity2.html' +developer: + name: DNA-seq + organization: DNA-seq + email: karmazinalex@gmail.com + website: https://github.com/dna-seq/opencravat-longevity + citation: '' +requires: + - just_cancer + - just_coronary + - just_drugs + - just_longevitymap + - just_prs +tags: +- input/output +- reporters +- longevity +data_version: 0.1.3 +release_note: +0.1.0: initial version +0.1.1: added prs support +0.1.2: bugfix rsid for prs, template improved +0.1.3: added Coronary arthery disease sub reporter, fixed bugs in prs sub report +0.1.4: in coranary sub report added color signaling and sorted by weight results +0.1.5: fixed bug in column acces for new version of oakvar +0.2.0: changed to fit new oakvar, not compatible with previuse versions of oak var +0.3.0: rebuilded reporter for new version of oakvar and postagregators \ No newline at end of file diff --git a/template.html b/template.html new file mode 100644 index 0000000..a7e08d1 --- /dev/null +++ b/template.html @@ -0,0 +1,727 @@ + + + +
+ + + + + + +This report is based on your raw file genome’s data cross-referencing against available genetic databases and constructing a report based on interpretations in these databases. Variant annotations were made with OakVar
+ [https://github.com/rkimoakbioinformatics/oakvar]. Annotation databases that was used for report generating: cadd_exome, gnomAD, pubmed, clinpred, clinvar, ncbigene, omim, prec, provean, revel, sift, LongevityMap.
+ Attention!The information provided is just for informational purposes. Its clinical implementation is possible just after consulting your healthcare practitioner. All drugs, vitamins and lifestyle changes may be prescribed just by your healthcare practitioner, based on clinical blood test results, family history etc. Genetical testing just provides additional information about possible health risk and risk management.
+ The report consists of:
There is data on Polygenic risk scores (PRSs) for gaining longevity.
+PRSs aggregate the effect of many common genetic variants to estimate a person’s chances of gaining extreme longevity. Each variant on its own tends little to the total outcome, but when added together, these differences can have a more significant impact. +
+ +PRS results are highly dependent on the population. PPS is calculated as a weighted sum of trait-associated alleles. PRS gives an estimate of how likely an individual is to have a given trait + only based on genetics, without taking environmental factors into account.
+ +How to read the result?
+ +PRS is represented as a percentile within a given population. For example, you have the 95th percentile, which means your genetic chances to gain extreme longevity is higher than 95 out of every 100 people in a chosen population. +
+ +So percentile >50 shows an increased genetic predisposition to longevity, <50 - decreased one. +
+ + + +PRS info |
+ This PRS includes an analysis of 332 variants that significantly discriminated between centenarians and older adults. +PRS source: https://doi.org/10.1093/gerona/glaa289 |
+
Title | ${data['prs'][g]['title']} (${data['prs'][g]['name']}) | |
Sum | ${data['prs'][g]['sum']} | |
Count/total | ${data['prs'][g]['count']}/${data['prs'][g]['total']} | |
Average | ${data['prs'][g]['avg']} | |
Percentile | ${data['prs'][g]['percent']}% |
How to read the result?
+ +PRS is represented as a percentile within a given population. For example, you have the 70th percentile, which means your personal genetic risk of the disease development is higher than 70 out of every 100 people in a chosen population. +
+ +So percentile >50 shows an increased risk, <50 - decreased one.
+Title | ${data['prs'][row]['title']} (${data['prs'][row]['name']}) | |
Sum | ${data['prs'][row]['sum']} | |
Count/total | ${data['prs'][row]['count']}/${data['prs'][row]['total']} | |
Average | ${data['prs'][row]['avg']} | |
Percentile | ${data['prs'][row]['percent']}% |
This report estimates how many significant longevity variations you have and whether its "a lot" or "not so" for your population. The data for this report is obtained mainly by studying centenarians’ genomes. +
+ +The longevity variants report is based on 1900 variants from LongevityMap (https://genomics.senescence.info/longevity/) and other data sources which are scored and prioritized according to multiple criteria. It also depends on ClinGene, dbSNP and ClinVar modules. +
+ +In the table you can see, how many significant for your population variants were found in your genome. Positively longevity-associated variants are marked with green, negatively associated - with red. +
+ | RSID | Population | Gene | +Your genotype | Ref allele | Alt allele | Zygosity | +Weight | +
---|---|---|---|---|---|---|---|---|
+ | ${row['snp']} | ${row['population']} | +${row['gene']} | +${row['nucleotides']} | ${row['ref']} | ${row['alt']} | ${row['zegot']} | ${row['weight']} | +
Plenty of drugs are frequently prescribed at an older age. Moreover, some drugs are known to have geroprotective action (e.g. statins, metformin, rapamycin, etc.). Drug metabolism to a large extent depends on a person’s genetic polymorphisms, affecting the activity of xenobiotics-transforming enzymes. So it’s a common situation when individual dose correction is needed, or even another drug has to be taken in order to avoid adverse effects. Longevity-drugs report is mainly based on data from PharmGKB database ( + https://www.pharmgkb.org/ + ) and DrugAge.
+ +In the table you can find data about your genome’s gene variants, associated with a changed response to the drugs. +
# | +Variant/Haplotypes | Drug(s) | Phenotype Category | Significance | Sentence | Allele Of Frequency In Cases | +Allele Of Frequency In Controls | Ratio Stat Type | Effect |
---|---|---|---|---|---|---|---|---|---|
${i} | ${rows['rsid']} | +${rows['drugs']} | ${rows['phencat']} | +${rows['significance']} | +${rows['sentence']} | ${rows['freqcases']} | ${rows['freqcontrols']} | +${rows['type']} | ${rows['effect']} |
It is not enough to have "centenarian" genes to become one: You have to cut down Your health risks before. This section contains information about the risk of developing chronic age-related diseases: cardiovascular, cancer, mental health, chronic inflammation, bone and muscle diseases, and lung diseases. +
# | +Chrom | Position | Gene | RSID | cDNA Change | Zygosity | +Allele Frequency | Phenotype Name | Significance | |
---|---|---|---|---|---|---|---|---|---|---|
${i} | ${row['chrom']} | +${row['pos']} | ${row['gene']} | +${row['rsid']} | +${row['cdnachange']} | ${row['zegot']} | ${row['alelfreq']} | +${row['phenotype']} | ${row['significance']} |
# | +RSID | Gene | Risck Allele | Genotype | Pubmed ID | +Population | P-Value | Weight | |
---|---|---|---|---|---|---|---|---|---|
${i} | +${row['rsid']} | +${row['gene']} | +${row['risk']} | +${row['genotype']} | ${row['pmid']} | ${row['population']} | +${row['pvalue']} | ${row['weight']} |