{"id":37723883,"url":"https://github.com/zavolanlab/tin-score-calculation","last_synced_at":"2026-01-16T13:36:33.262Z","repository":{"id":47839681,"uuid":"344773585","full_name":"zavolanlab/tin-score-calculation","owner":"zavolanlab","description":"Given a set of BAM files and a gene annotation BED file, calculates the Transcript Integrity Number (TIN) for each transcript.","archived":false,"fork":false,"pushed_at":"2021-10-29T11:28:25.000Z","size":2248,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":6,"default_branch":"dev","last_synced_at":"2024-12-06T20:43:33.938Z","etag":null,"topics":["bioinformatics","high-throughput-sequencing","quality-control","rna-seq"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zavolanlab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-05T10:23:30.000Z","updated_at":"2023-08-15T17:19:18.000Z","dependencies_parsed_at":"2022-09-24T11:30:13.132Z","dependency_job_id":null,"html_url":"https://github.com/zavolanlab/tin-score-calculation","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/zavolanlab/tin-score-calculation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zavolanlab%2Ftin-score-calculation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zavolanlab%2Ftin-score-calculation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zavolanlab%2Ftin-score-calculation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zavolanlab%2Ftin-score-calculation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zavolanlab","download_url":"https://codeload.github.com/zavolanlab/tin-score-calculation/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zavolanlab%2Ftin-score-calculation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bioinformatics","high-throughput-sequencing","quality-control","rna-seq"],"created_at":"2026-01-16T13:36:32.738Z","updated_at":"2026-01-16T13:36:33.249Z","avatar_url":"https://github.com/zavolanlab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![ci](https://github.com/zavolanlab/tin-score-calculation/workflows/ci/badge.svg?branch=dev)](https://github.com/zavolanlab/tin-score-calculation/actions?query=workflow%3Aci)\n[![CodeFactor](https://www.codefactor.io/repository/github/zavolanlab/tin-score-calculation/badge)](https://www.codefactor.io/repository/github/zavolanlab/tin-score-calculation)\n[![GitHub issues](https://img.shields.io/github/issues/zavolanlab/tin-score-calculation)](https://github.com/zavolanlab/tin-score-calculation/issues)\n[![GitHub license](https://img.shields.io/github/license/zavolanlab/tin-score-calculation)](https://github.com/zavolanlab/tin-score-calculation/blob/dev/LICENSE)\n\n# TIN score calculation\n\nGiven a set of BAM files and a gene annotation BED file, calculates the\nTranscript Integrity Number (TIN) for each transcript.\n\n## Main usage\n\n```sh\npython calculate-tin.py [-h] [options]\n```\n\n### Parameters\n\n```console\n  --version             show program's version number and exit\n  -h, --help            show this help message and exit\n  -i INPUT_FILES, --input=INPUT_FILES\n                        Input BAM file(s). \"-i\" takes these input: 1) a single\n                        BAM file. 2) \",\" separated BAM files (no spaces\n                        allowed). 3) directory containing one or more bam\n                        files. 4) plain text file containing the path of one\n                        or more bam files (Each row is a BAM file path). All\n                        BAM files should be sorted and indexed using samtools.\n                        [required]\n  -r REF_GENE_MODEL, --refgene=REF_GENE_MODEL\n                        Reference gene model in BED format. Must be strandard\n                        12-column BED file. [required]\n  -c MINIMUM_COVERAGE, --minCov=MINIMUM_COVERAGE\n                        Minimum number of read mapped to a transcript.\n                        default=10\n  -n SAMPLE_SIZE, --sample-size=SAMPLE_SIZE\n                        Number of equal-spaced nucleotide positions picked\n                        from mRNA. Note: if this number is larger than the\n                        length of mRNA (L), it will be halved until it's\n                        smaller than L. default=100\n  --names=SAMPLE_NAMES  sample names, comma separated (no spaces allowed);\n                        number must match the number of provided bam_files\n  -s, --subtract-background\n                        Subtract background noise (estimated from intronic\n                        reads). Only use this option if there are substantial\n                        intronic reads.\n  -p NRPROCESSES, --processes=NRPROCESSES\n                        Number of child processes for the parallelization.\n                        Default: 1\n```\n\n### File formats\n\n- [BAM](https://samtools.github.io/hts-specs/SAMv1.pdf)\n- [BED](https://www.ensembl.org/info/website/upload/bed.html)\n\nSample output ([TSV](https://en.wikipedia.org/wiki/Tab-separated_values)):\n\n```console\ntranscript         sample_name\nENST00000303113    80.6328743265\nENST00000427445    0\nENST00000430792    59.7324017312\nENST00000647504    84.8860204563\nENST00000398647    64.4764470574\nENST00000400202    69.6331415873\nENST00000455813    85.3605191157\nENST00000397854    92.3965306733\nENST00000630077    72.8829044591\n```\n\n### Information\n\nThe tool was forked off the script `tin.py` (v2.6.4) of the\n[`RSeQC`](http://rseqc.sourceforge.net/) package to achieve some speed-up.\n\nThis program calculates transcript integrity number (TIN) for each transcript\n(or gene) in BED file. TIN is conceptually similar to RIN (RNA integrity number)\nbut provides transcript level measurement of RNA quality and is more sensitive\nto measure low quality RNA samples:\n\n1. TIN score of a transcript is used to measure the RNA integrity of the\ntranscript.\n2. Median TIN score across all transcripts can be used to measure RNA integrity\nof that \"RNA sample\".\n3. TIN ranges from 0 (the worst) to 100 (the best). TIN = 60 means: 60% of the\ntranscript has been covered if the reads coverage were uniform.\n4. TIN will be assigned to 0 if the transcript has no coverage or covered reads\nis fewer than cutoff.\n\n## Extended usage\n\nAdditionaly, this repository has been updated with three simple Python scripts.\n\n### TIN score merging\n\nMerge TIN score tables for multiple samples.\n\n```sh\npython merge-tin.py [-h] [options]\n```\n\n#### Parameters\n\n```console\n  -h, --help            show this help message and exit\n  -v {DEBUG,INFO,WARN,ERROR,CRITICAL}, --verbosity {DEBUG,INFO,WARN,ERROR,CRITICAL}\n                        Verbosity/Log level. Defaults to ERROR\n  -l LOGFILE, --logfile LOGFILE\n                        Store log to this file.\n  --input-files INFILES\n                        Space-separated paths to the input tables.\n  --output-file OUTFILE\n                        Path for the outfile with merged TIN scores\n```\n\nOutput file is formatted in a TSV table as well.\n\n### TIN score plotting\n\nCreate per-sample [boxplots](https://en.wikipedia.org/wiki/Box_plot) of TIN scores.\n\n```sh\npython plot-tin.py [-h] [options]\n```\n\n#### Parameters\n\n```console\n  -h, --help            show this help message and exit\n  -v {DEBUG,INFO,WARN,ERROR,CRITICAL}, --verbosity {DEBUG,INFO,WARN,ERROR,CRITICAL}\n                        Verbosity/Log level. Defaults to ERROR\n  -l LOGFILE, --logfile LOGFILE\n                        Store log to this file.\n  --input-file INFILE   Path to the table with merged TIN scores\n  --output-file-prefix OUTFILE_PREFIX\n                        Prefix for the path to the TIN boxplots.\n```\n\nThe boxplots are generated in [PDF](https://en.wikipedia.org/wiki/PDF) and\n[PNG](https://en.wikipedia.org/wiki/Portable_Network_Graphics) formats under\n`output-file-prefix`+`.pdf` and `output-file-prefix`+`.png`.\n\n### TIN score summary\n\nCalculate simple summary statistics for the per-sample TIN scores.\n\n```sh\npython summarize-tin.py [-h] [options]\n```\n\n#### Parameters\n\n```console\n  -h, --help            show this help message and exit\n  -v {DEBUG,INFO,WARN,ERROR,CRITICAL}, --verbosity {DEBUG,INFO,WARN,ERROR,CRITICAL}\n                        Verbosity/Log level. Defaults to ERROR\n  -l LOGFILE, --logfile LOGFILE\n                        Store log to this file.\n  --input-file INFILE   Path to the table with merged TIN scores\n  --output-file OUTFILE\n                        Path for the output table with TIN statistics.\n```\n\nOutput file is formatted in a TSV table as well.\n\n## Run locally\n\nIn order to use the scripts you will need to clone this repository and install\nthe dependencies:\n\n```sh\ngit clone https://github.com/zavolanlab/tin-score-calculation\ncd tin-score-calculation\npip install .\n```\n\nAlternatively you can install it via pypi by:\n```sh\npip install tin-score-calculation\n```\n\nAlternatively you can install it via conda by:\n\n```sh\nconda install -c bioconda -c conda-forge tin-score-calculation\n```\n\n\u003e **NOTES:**  \n\u003e  \n\u003e - You may want to install dependencies inside a virtual environment,\n\u003e   e.g., using [`virtualenv`](https://virtualenv.pypa.io/en/latest/). Alternatively, if you use [`conda`](https://docs.conda.io/en/latest/) we provide an environment recipe too - in such case just run `conda env create`.\n\u003e - Some of the dependencies require specific system libraries to be installed, this however should be taken care of by the package manager.\n\nYou can then find the scripts in directory `scripts/` and run it as described in\nthe [Main usage](#main-usage) and [Extended usage](#extended-usage) sections.\nTo run the tool with minimum test files, try:\n\n```sh\ncalculate-tin.py \\\n-i .test/calculate-tin/sample.bam \\\n-r .test/calculate-tin/transcripts.bed \\\n--names \"sample_name\" \\\n1\u003e .test/calculate-tin/test.tsv\n\nmerge-tin.py \\\n--input-files .test/merge-tin/sample_1.tsv .test/merge-tin/sample_2.tsv \\\n--output-file .test/merge-tin/test.tsv\n\nplot-tin.py \\\n--input-file .test/plot-tin/merged.tsv \\\n--output-file-prefix .test/plot-tin/test\n\nsummarize-tin.py \\\n--input-file .test/summarize-tin/merged.tsv \\\n--output-file .test/summarize-tin/test.tsv\n```\n\n## Run inside container\n\nIf you have [Docker](https://www.docker.com/) installed, you can also pull the\nDocker image:\n\n```sh\ndocker pull quay.io/biocontainers/tin-score-calculation:0.6--pyh5e36f6f_0\n```\n\nYou can execute the scripts as following:\n\n```sh\ndocker run -it quay.io/biocontainers/tin-score-calculation:0.6--pyh5e36f6f_0 calculate-tin.py --help\ndocker run -it quay.io/biocontainers/tin-score-calculation:0.6--pyh5e36f6f_0 merge-tin.py --help\ndocker run -it quay.io/biocontainers/tin-score-calculation:0.6--pyh5e36f6f_0 plot-tin.py --help\ndocker run -it quay.io/biocontainers/tin-score-calculation:0.6--pyh5e36f6f_0 summarize-tin.py --help\n```\n\n\u003e **NOTE:** To run the tool on your own data in that manner, you will probably\n\u003e need to [mount a volume](https://docs.docker.com/storage/volumes/) to allow\n\u003e the container read input files and write persistent output from/to the host\n\u003e file system.\n\n## Version\n\n0.6.3\n\n## Contact\n\nPlease see the [list of contributors](contributors.md) for contact information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzavolanlab%2Ftin-score-calculation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzavolanlab%2Ftin-score-calculation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzavolanlab%2Ftin-score-calculation/lists"}