Skip to content

Commit

Permalink
Merge pull request #5 from AmpliconSuite/develop
Browse files Browse the repository at this point in the history
version 4.1, fixes issues with CLI use of Aggregator, improves logging
  • Loading branch information
edwin5588 authored Nov 27, 2023
2 parents aed987f + eab5dc8 commit 5262d7a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ Aggregates the results from AmpliconSuite
## Installation
- Option 1: Git Clone
- Step 1: `git clone https://github.com/genepattern/AmpliconSuiteAggregator.git`
- Step 2: Install python package dependencies from list below.
- **If running into dependency issues, please use the docker methods.**
- Option 2: Docker
- Step 1: `docker pull genepattern/amplicon-suite-aggregator`

## Dependencies
- List of dependencies used: intervaltree, matplotlib, numpy, pandas, Pillow, requests, scipy, urllib3
- List of python package dependencies used: intervaltree, matplotlib, numpy, pandas, Pillow, requests, scipy, urllib3

## Options when running locally
### Amplicon Suite Aggregator related options
Expand Down
6 changes: 3 additions & 3 deletions manifest
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ p7_TYPE=FILE
p7_default_value=
p7_description=A two column file providing current identifier for each sample (col 1), and a replacement name (col 2).
p7_fileFormat=
p7_flag=--name_map
p7_flag=--name_map
p7_name=name.map
p7_numValues=0..1
p7_optional=on
p7_prefix=--name_map
p7_prefix_when_specified=--name_map
p7_prefix=--name_map
p7_prefix_when_specified=--name_map
p7_type=java.io.File
p7_value=
privacy=public
Expand Down
6 changes: 3 additions & 3 deletions src/AmpliconSuiteAggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from AmpliconSuiteAggregatorFunctions import *
from ASA_POST import *

__version__ = "4.0"
__version__ = "4.1"


def get_zip_paths(filelist_fp):
Expand All @@ -33,11 +33,11 @@ def get_zip_paths(filelist_fp):
group.add_argument("--files", nargs='+', type=str, help="List of files or directories to use")
parser.add_argument("-o", "--output_name", type=str, help="Output Prefix and/or project name for site upload", default="output")
parser.add_argument("-u", "--username", type=str, help = "Email address for Amplicon Repository. Setting this will "
"trigger an attempt to upload the aggregated file to AmpliconRepository.org", required=False)
"trigger an attempt to upload the aggregated file to AmpliconRepository.org", required=False, default="")
# parser.add_argument('-t', '--testing', action = 'store_true', required = False) # JL: This seems to be unused
parser.add_argument("--upload_only", type=str, help="If 'Yes', then skip aggregation and classification and upload "
"the file as is. Note: the file must already be aggregated to successfully upload.",
choices=['Yes', 'No'])
choices=['Yes', 'No'], default="No")
parser.add_argument("--name_map", type=str, help="A two column file providing the current identifier for each sample (col 1)"
" and a replacement name (col 2). Enables batch renaming of samples.")
parser.add_argument("-c", "--run_classifier",type=str, help="If 'Yes', then run Amplicon Classifier on AA results. \
Expand Down
10 changes: 8 additions & 2 deletions src/AmpliconSuiteAggregatorFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ def read_name_remap(name_remap_file):
fields = l.rstrip().rsplit()
name_remap[fields[0]] = fields[1]

print("Name remap has " + str(len(name_remap)) + " keys")
print("Name remap has " + str(len(name_remap)) + " keys")

else:
print("No name remap file provided. Sample names will detected from filenames.")

return name_remap


Expand Down Expand Up @@ -419,7 +423,9 @@ def json_modifications(self):
feat_file = feat_file.replace('./results/', "")
sample_dct['Feature BED file'] = feat_file
else:
print(f'Feature: "Feature BED file" {feat_file} doesnt exist for sample {sample_dct["Sample name"]}')
if not feat_file.endswith("/NA"):
print(f'Feature: "Feature BED file" {feat_file} doesnt exist for sample {sample_dct["Sample name"]}')

sample_dct['Feature BED file'] = "Not Provided"

else:
Expand Down

0 comments on commit 5262d7a

Please sign in to comment.