-
Notifications
You must be signed in to change notification settings - Fork 5
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
9 changed files
with
205 additions
and
1,922 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,27 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# Define self package variable | ||
__version__ = "0.1.a2" | ||
__version__ = "0.1.a3" | ||
__all__ = ["NanoCount", "Read"] | ||
|
||
description = 'EM based transcript abundance from nanopore reads mapped to a transcriptome with minimap2' | ||
|
||
# Collect info in a dictionary for setup.py | ||
setup_dict = { | ||
"name": __name__, | ||
"version": __version__, | ||
"description": description, | ||
"url": "https://github.com/a-slide/NanoCount", | ||
"author": 'Adrien Leger', | ||
"author_email": 'aleg {at} ebi.ac.uk', | ||
"license": "MIT", | ||
"python_requires":'>=3.5', | ||
"classifiers": [ | ||
'Development Status :: 3 - Alpha', | ||
'Intended Audience :: Science/Research', | ||
'Topic :: Scientific/Engineering :: Bio-Informatics', | ||
'License :: OSI Approved :: MIT License', | ||
'Programming Language :: Python :: 3'], | ||
"install_requires": ['pysam>=0.14.1', 'pandas>=0.23.3'], | ||
"packages": [__name__], | ||
"entry_points":{'console_scripts': ['NanoCount = NanoCount.NanoCount:main']}} | ||
__description__ = 'EM based transcript abundance from nanopore reads mapped to a transcriptome with minimap2' |
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,54 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
#~~~~~~~~~~~~~~IMPORTS~~~~~~~~~~~~~~# | ||
|
||
# Standard library imports | ||
import argparse | ||
from collections import * | ||
|
||
# Local imports | ||
from NanoCount import __version__ as package_version | ||
from NanoCount import __name__ as package_name | ||
from NanoCount import __description__ as package_description | ||
from NanoCount.NanoCount import NanoCount as nc | ||
|
||
#~~~~~~~~~~~~~~MAIN PARSER ENTRY POINT~~~~~~~~~~~~~~# | ||
|
||
def main(args=None): | ||
|
||
# Define parser | ||
parser = argparse.ArgumentParser(description=package_description) | ||
parser.add_argument('--version', '-v', action='version', version="{} v{}".format(package_name, package_version)) | ||
parser.add_argument('-i', '--alignment_file', type=str, required=True, | ||
help="BAM or SAM file containing aligned ONT dRNA-Seq reads including secondary and supplementary alignment") | ||
parser.add_argument('-o', '--count_file', type=str, required=True, | ||
help="Output count file") | ||
parser.add_argument('--min_read_length', type=int, default=50, | ||
help="Minimal length of the read to be considered valid") | ||
parser.add_argument('--min_query_fraction_aligned', type=float, default=0.5, | ||
help="Minimal fraction of the primary hit query aligned to consider the read valid") | ||
parser.add_argument('--equivalent_threshold', type=float, default=0.9, | ||
help="Fraction of the alignment score or the alignment length of secondary hits compared to the primary hit to be considered valid hits") | ||
parser.add_argument('--scoring_value', type=str, default="alignment_score", | ||
help="Value to use for score thresholding of secondary hits. Either alignment_score or alignment_length") | ||
parser.add_argument('--convergence_target', type=float, default=0.005, | ||
help="Convergence target value of the cummulative difference between abundance values of successive EM round to trigger the end of the EM loop") | ||
parser.add_argument('--verbose', default=False, action='store_true', | ||
help="If True will be chatty") | ||
args = parser.parse_args() | ||
|
||
nanocount = nc ( | ||
alignment_file =args.alignment_file, | ||
min_read_length =args.min_read_length, | ||
min_query_fraction_aligned =args.min_query_fraction_aligned, | ||
equivalent_threshold =args.equivalent_threshold, | ||
scoring_value =args.scoring_value, | ||
convergence_target =args.convergence_target, | ||
verbose =args.verbose) | ||
|
||
nanocount.write_count_file (args.count_file) | ||
|
||
# execute only if run as a script | ||
if __name__ == "__main__": | ||
main() |
File renamed without changes.
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 |
---|---|---|
|
@@ -2,5 +2,26 @@ | |
# -*- coding: utf-8 -*- | ||
|
||
from setuptools import setup | ||
from NanoCount import setup_dict | ||
setup(**setup_dict) | ||
import NanoCount as package | ||
|
||
# Collect info in a dictionary for setup.py | ||
setup( | ||
name = package.__name__, | ||
version = package.__version__, | ||
description = package.__description__, | ||
url = "https://github.com/a-slide/NanoCount", | ||
author = 'Adrien Leger', | ||
author_email = '[email protected]', | ||
license = "MIT", | ||
python_requires ='>=3.5', | ||
classifiers = [ | ||
'Development Status :: 3 - Alpha', | ||
'Intended Audience :: Science/Research', | ||
'Topic :: Scientific/Engineering :: Bio-Informatics', | ||
'License :: OSI Approved :: MIT License', | ||
'Programming Language :: Python :: 3'], | ||
install_requires = [ | ||
'pysam>=0.14.1', | ||
'pandas>=0.23.3'], | ||
packages = [package.__name__], | ||
entry_points = {'console_scripts': ['NanoCount = NanoCount.__main__:main']}) |
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,4 @@ | ||
transcript_name raw est_count tpm | ||
VIII 0.6 3.0 3000000.0 | ||
IV 0.2 1.0 1000000.0 | ||
V 0.2 1.0 1000000.0 |
Oops, something went wrong.