Skip to content

Commit

Permalink
Merge pull request #24 from remiolsen/dev
Browse files Browse the repository at this point in the history
Finalise 0.4.2
  • Loading branch information
remiolsen authored Feb 10, 2022
2 parents fa415e3 + 3e2e9f2 commit e49022f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pip install bio-anglerfish
### From Bioconda

```
conda install -c bioconda multiqc
conda install -c bioconda anglerfish
```

### Manually with Conda
Expand Down
16 changes: 14 additions & 2 deletions anglerfish/anglerfish.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import json
import pkg_resources
import numpy as np
import uuid
from datetime import datetime as dt
from itertools import groupby
from collections import Counter
Expand All @@ -20,11 +21,13 @@

def run_demux(args):

run_uuid = str(uuid.uuid4())
os.mkdir(args.out_fastq)
ss = SampleSheet(args.samplesheet)
version = pkg_resources.get_distribution("bio-anglerfish").version
log.info(" version {}".format(version))
log.info(" arguments {}".format(vars(args)))
log.info(" run uuid {}".format(run_uuid))
bc_dist = ss.minimum_bc_distance()
if bc_dist == 0:
log.error("There is one or more identical barcodes in the input samplesheet. Aborting!")
Expand Down Expand Up @@ -118,9 +121,16 @@ def run_demux(args):

header1 = ["sample_name","#reads","mean_read_len","std_read_len"]
header2 = ["undetermined_index","count"]
json_out = {"anglerfish_version":version,"paf_stats": [], "sample_stats": [], "undetermined": []}
json_out = {
"anglerfish_version":version,
"run_name": args.run_name,
"run_uuid": run_uuid,
"paf_stats": [],
"sample_stats": [],
"undetermined": []
}
with open(os.path.join(args.out_fastq,"anglerfish_stats.txt"), "w") as f:
f.write("Anglerfish v. "+version+"\n===================\n")
f.write(f"Anglerfish v. {version} (run: {args.run_name}, {run_uuid})\n===================\n")
for key, line in paf_stats.items():
f.write(f"{key}:\n")
for i,j in line.items():
Expand Down Expand Up @@ -151,6 +161,7 @@ def anglerfish():
parser.add_argument('--skip_fastqc', '-f', action='store_true', help=argparse.SUPPRESS)
parser.add_argument('--max-distance', '-m', type=int, help='Manually set maximum edit distance for BC matching, automatically set this is set to either 1 or 2')
parser.add_argument('--debug', '-d', action='store_true', help='Extra commandline output')
parser.add_argument('--version', '-v', action='version', help='Print version and quit', version='anglerfish {}'.format(pkg_resources.get_distribution("bio-anglerfish").version))
args = parser.parse_args()
utcnow = dt.utcnow()
runname = utcnow.strftime("anglerfish_%Y_%m_%d_%H%M%S")
Expand All @@ -159,4 +170,5 @@ def anglerfish():
assert os.path.exists(args.samplesheet)
args.out_fastq = os.path.join(os.path.abspath(args.out_fastq),runname)
args.samplesheet = os.path.abspath(args.samplesheet)
args.run_name = runname
run_demux(args)
5 changes: 2 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ channels:
- bioconda
dependencies:
- conda-forge::biopython=1.79
- conda-forge::python-levenshtein=0.12.0
- conda-forge::numpy=1.19.2
- conda-forge::python-levenshtein=0.12.1
- conda-forge::numpy=1.21.0
- bioconda::minimap2=2.20

10 changes: 6 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name='bio-anglerfish',
version='0.4.2-rc.1',
version='0.4.2',
description='Anglerfish, a tool to demultiplex Illumina libraries from ONT data',
author='Remi-Andre Olsen',
author_email='[email protected]',
Expand All @@ -13,7 +13,7 @@
python_requires=">=3.7",
packages = find_packages(),
install_requires=[
'python-levenshtein==0.12.0',
'python-levenshtein==0.12.1',
'biopython==1.79',
'numpy==1.21.0'
],
Expand All @@ -24,14 +24,16 @@
},
zip_safe=False,
classifiers=[
"Development Status :: 3 - Alpha",
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Healthcare Industry",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Medical Science Apps."
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Medical Science Apps.",
"Topic :: Scientific/Engineering :: Bio-Informatics"
]
)

0 comments on commit e49022f

Please sign in to comment.