https://github.com/kundajelab/seqdataloader
Sequence data label generation and ingestion into deep learning models
Science Score: 10.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
2 of 6 committers (33.3%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.9%) to scientific vocabulary
Keywords from Contributors
Repository
Sequence data label generation and ingestion into deep learning models
Basic Info
- Host: GitHub
- Owner: kundajelab
- License: mit
- Language: Python
- Default Branch: master
- Size: 3.92 MB
Statistics
- Stars: 12
- Watchers: 25
- Forks: 3
- Open Issues: 4
- Releases: 0
Metadata Files
README.md
seqdataloader
Sequence data label generation and ingestion into deep learning models
Installation
pip install seqdataloader
If you plan to modify the code, you can install it in development mode:
pip install -e seqdataloader
Please note: to use the "dbingest" functionality in seqdataloader, python>=3.7 is needed.
Quick Start
labelgen
The input for the labelgen submodule is a 4 column tab-delimited file with the following fields:
- "task" -- required. User-specified task name
- "narrowPeak" -- Path to narrowPeak file. (Optional if "bigwig" is specified.)
- "bigwig" -- Path to bigwig file (optional if "narrowPeak" is specified.)
- "ambig" -- bed file containing user-specified regions to label as ambiguous (optional)
genomewide_labels --task_list tasks.tsv \
--outf classificationlabels.SummitWithin200bpCenter.tsv.gz \
--output_type gzip \ # (one of gzip, bz2, hdf5, pkl)
--chrom_sizes hg38.chrom.sizes \
--bin_stride 50 \
--left_flank 400 \
--right_flank 400 \
--bin_size 200 \
--task_hreads 10 \
--chrom_threads 4 \
--allow_ambiguous \
--labeling_approach peak_summit_in_bin_classification
And for regression:
genomewide_labels --task_list tasks.tsv \
--outf regressionlabels.allbins.hg38.hdf5 \
--output_type hdf5 \
--chrom_sizes hg38.chrom.sizes \
--bin_stride 50 \
--left_flank 400 \
--right_flank 400 \
--chrom_threads 24 \
--task_threads 2 \
--label_transformer asinh \ one of None, asinh, log10, log, default is asinh
--labeling_approach all_genome_bins_regression
labeling_approach can be one of:
"peak_summit_in_bin_classification"
"peak_percent_overlap_with_bin_classification"
"peak_summit_in_bin_regression"
"peak_percent_overlap_with_bin_regression"
"all_genome_bins_regression"
How to run
Sample datasets are included in the folder examples/peak_files_from_encode_for_label_comparison and examples/bigwig_files_from_encode_for_label_comparison
Executing seqdataloader as a script:
Execute the script:
examples/genomewide_labels.sh for examples on how to generate classification and regression labels on sample datasets.
The script generates binary classification labels (1,0,-1 for ambiguous) or continuous regression labels reflective of bigWig coverage in a bin in bed file format:
http://mitra.stanford.edu/kundaje/seqdataloader/classificationlabels.50PercentOverlap.tsv.gz
http://mitra.stanford.edu/kundaje/seqdataloader/classificationlabels.SummitWithin200bpCenter.tsv.gz
http://mitra.stanford.edu/kundaje/seqdataloader/regressionlabels.50PercentOverlap.tsv.gz
http://mitra.stanford.edu/kundaje/seqdataloader/regressionlabels.SummitWithin200bpCenter.tsv.gz
Corresponding WashU Browser Tracks with optimal narrowPeak and associated bin labels are here: http://epigenomegateway.wustl.edu/legacy/?genome=hg38&session=GDB2BTMGnB&statusId=1154897038
calling seqdataloader as a Python function:
``` from seqdataloader import * classificationparams={ 'tasklist':"tasks.tsv", 'outf':"classificationlabels.SummitWithin200bpCenter.tsv.gz", 'outputtype':'gzip', 'chromsizes':'hg38.chrom.sizes', 'chromstokeep':['chr21'], "storepositivesonly":True, 'binstride':50, 'leftflank':400, 'rightflank':400, 'binsize':200, 'chromthreads':10, 'taskthreads':4, 'allowambiguous':True, 'labelingapproach':'peaksummitinbinclassification' } genomewidelabels(classificationparams)
regressionparams={ 'tasklist':"tasks.tsv", 'outf':"regressionlabels.allgenomebinsregression.hdf5", 'outputtype':'hdf5', 'chromsizes':'hg38.chrom.sizes', 'storevaluesabovethresh': 0, 'chromstokeep':['chr21'], 'binstride':50, 'leftflank':400, 'rightflank':400, 'binsize':200, 'chromthreads':10, 'taskthreads':4, 'labelingapproach':'allgenomebinsregression', 'labeltransformer':'log10', 'labeltransfomerpseudocount':0.001 } genomewidelabels(regression_params) ```
Regression label transformations
In regression mode ( "peaksummitinbinregression", "peakpercentoverlapwithbinregression", "allgenomebinsregression"), the generated labels can be transformed in one of several ways. You can use the arguments label_transformer and label_transformer_pseudocount to specify the desired tranformation. Allowed values are:
- asinh -- numpy.arcsinh(values) will be computed (this is the default)
- None -- no label transformation will be performed
- log10 -- numpy.log10(values + pseudocount) will be computed using a pseudocount specified by
label_transformer_pseudocountargument. If this argument is not provided,a default pseudocout of 0.001 is used. - log -- numpy.log(values + pseudocount) will be computed using a pseudcount as above.
A note on file outputs
The code supports several output types: hdf5, gzip, pkl, bz2.
Specify your desired output type with the flag --output_type. The default setting for this flag is gzip
Please note that the large bottleneck in the code is writing the files to disk. hdf5 has negligible overhead, but using gzip or bz2 may increase runtime. Timining benchmarks are provided in examples/genomewide_labels.sh
You may speed up i/o by writing chromosome outputs to separate files in parallel. This is currently only supported for the gzip and bz2 output types, as i/o is less of a bottleneck for hdf5 and pkl output formats. Use the flag --split_output_by_chrom to invoke this parallelized saving of chromosomes.
dbingest
The input tsv file must have a subset of the columns corresponding to the supported configurations: ``` * encodeconfig ** dataset ** fcbigwig ** pvalbigwig ** countbigwigplus5p ** countbigwigminus5p ** countbigwigunstranded5p ** idrpeak ** overlappeak ** ambig_peak
- genericbigwig ** bigwigtrack
```
Dependencies
Please make sure the following dependencies are installed on your system to use SeqDataLoader: * pybedtools * pyBigWig * pandas * numpy * multiprocessing
Documentation and benchmarks
Testing, benchmarks, and documentation can be found in the docs folder
Owner
- Name: Kundaje Lab
- Login: kundajelab
- Kind: organization
- Location: Stanford University
- Website: http://anshul.kundaje.net
- Repositories: 117
- Profile: https://github.com/kundajelab
Compbio and machine learning code repositories from the Kundaje Lab at Stanford Genetics and Computer Science Depts.
GitHub Events
Total
Last Year
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| anna shcherbina | a****a@g****m | 198 |
| Avanti Shrikumar | a****r@g****m | 42 |
| Anon | b****h | 33 |
| soumyakundu | s****u@s****u | 6 |
| annashcherbina | a****h@s****u | 1 |
| root | r****t@i****l | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 8
- Total pull requests: 12
- Average time to close issues: 5 days
- Average time to close pull requests: about 2 hours
- Total issue authors: 3
- Total pull request authors: 3
- Average comments per issue: 0.5
- Average comments per pull request: 0.0
- Merged pull requests: 12
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- annashcherbina (6)
- alexandari (1)
- amtseng (1)
Pull Request Authors
- annashcherbina (6)
- soumyakundu (4)
- AvantiShri (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 25 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 22
- Total maintainers: 1
pypi.org: seqdataloader
Generate genome-wide classification and regression labels for DNA accessibility data.
- Homepage: https://github.com/kundajelab/seqdataloader
- Documentation: https://seqdataloader.readthedocs.io/
- License: mit
-
Latest release: 1.2
published over 5 years ago
Rankings
Maintainers (1)
Dependencies
- cython >=0.27.3
- deeptools >=3.0.1
- numpy >=1.15
- pandas >=0.23.4
- psutil *
- pyBigWig >=0.3.7
- pybedtools >=0.7
- pyfaidx *
- tiledb >=0.4.4