fastmatchirida
Quickly refines a reference set of samples based on distance.
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.6%) to scientific vocabulary
Repository
Quickly refines a reference set of samples based on distance.
Basic Info
- Host: GitHub
- Owner: phac-nml
- License: mit
- Language: Nextflow
- Default Branch: main
- Size: 2.96 MB
Statistics
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
- Releases: 10
Metadata Files
README.md
FastMatch IRIDA Workflow
This workflow takes query and reference JSON-formatted MLST profiles and reports query-reference pairs that are sufficiently within a specified distance of each other.
A brief overview of the usage of this pipeline is given below. Further documentation can be found in the docs directory.
Input
The input to the pipeline is a standard sample sheet (passed as --input samplesheet.csv) that looks like:
| sample | fastmatchcategory | mlstalleles | metadata1 | metadata2 | metadata3 | metadata4 | metadata5 | metadata6 | metadata7 | metadata8 | metadata9 | metadata10 | metadata11 | metadata12 | metadata13 | metadata14 | metadata15 | metadata16 | | ------- | ------------------ | ----------------- | ---------- | ---------- | ---------- | ---------- | ---------- | ---------- | ---------- | ---------- | ---------- | ----------- | ----------- | ----------- | ----------- | ----------- | ----------- | ----------- | | SampleA | query | sampleA.mlst.json | meta1 | meta2 | meta3 | meta4 | meta5 | meta6 | meta7 | meta8 | meta9 | meta10 | meta11 | meta12 | meta13 | meta14 | meta15 | meta16 | | SampleB | reference | sampleB.mlst.json | meta1 | meta2 | meta3 | meta4 | meta5 | meta6 | meta7 | meta8 | meta9 | meta10 | meta11 | meta12 | meta13 | meta14 | meta15 | meta16 |
Note that each sample must be defined as a query or reference. Samples designated with query will have their distance calculated to every sample in the sample sheet (query and reference samples), whereas reference-reference sample pairings do not have their distances calculated or reported.
The structure of this file is defined in assets/schema_input.json. Validation of the sample sheet is performed by nf-validation. Details on the columns can be found in the Full Samplesheet documentation.
Irida Next Optional Sample Name Configuration
fastmatchirida accepts the IRIDA Next format for samplesheets which can contain an additional column: sample_name
sample_name: An optional column, that overrides sample for outputs (filenames and sample names) and reference assembly identification.
sample_name allows more flexibility in naming output files or sample identification. Unlike sample, sample_name is not required to contain unique values. Nextflow requires unique sample names, and therefore in the instance of repeat sample_names, sample will be suffixed to any sample_name. Non-alphanumeric characters (excluding _,-,.) will be replaced with "_".
Parameters
The main parameters are --threshold, --input as defined above and --output for specifying the output results directory. You may wish to provide -profile singularity to specify the use of singularity containers and -r [branch] to specify which GitHub branch you would like to run.
--thresholdthe minimum alleles for filtering matches (default: 50)
Metadata
In order to customize metadata headers, the parameters --metadata_1_header through --metadata_16_header may be specified. These parameters are used to re-name the headers in the final metadata table from the defaults (e.g., rename metadata_1 to country).
LOCIDEX
When large samplesheets are provided to LOCIDEX, they are split-up, into batches (default batch size: 100), to allow for LOCIDEX_MERGE to be run in parallel. To modify the size of batches use the parameter --batch_size n
Distance Threshold
A distance threshold parameter may be used to constrain the maximum distances between reported sample pairs in the final reports. This can be accomplished by specifying --threshold DISTANCE, where DISTANCE is a non-negative integer when using Hamming distances or a float between [0.0, 100.0] when using scaled distances. See below for more information on these distance methods.
Distance Methods
The distance measurement used can be one of two methods: Hamming or scaled.
Hamming Distances
Hamming distances are integers representing the number of differing loci between two sequences and will range between [0, n], where n is the total number of loci. When using Hamming distances, you must specify --pd_distm hamming.
Scaled Distances
Scaled distances are floats representing the percentage of differing loci between two sequences and will range between [0.0, 100.0]. When using scaled distances, you must specify --pd_distm scaled.
profile_dists
The following can be used to adjust parameters for the profile_dists tool.
--pd_distm: The distance method/unit, either hamming or scaled. For hamming distances, the distance values will be a non-negative integer. For scaled distances, the distance values are between 0.0 and 100.0. Please see the Distance Method section for more information.--pd_missing_threshold: The maximum proportion of missing data per locus for a locus to be kept in the analysis. Values from 0.0 to 1.0.--pd_sample_quality_threshold: The maximum proportion of missing data per sample for a sample to be kept in the analysis. Values from 0.0 to 1.0.--pd_file_type: Output format file type. One of text or parquet.--pd_mapping_file: A file used to map allele codes to integers for internal distance calculations. Normally, this is unneeded unless you wish to override the automated process of mapping alleles to integers.--pd_skip: Skip QA/QC steps. Can be used as a flag,--pd_skip, or passing a boolean,--pd_skip trueor--pd_skip false.--pd_columns: Defines the loci to keep within the analysis (default when unset is to keep all loci). Formatted as a single column file with one locus name per line. For example:- Single column format
loci1 loci2 loci3
- Single column format
--pd_count_missing: Count missing alleles as different. Can be used as a flag,--pd_count_missing, or passing a boolean,--pd_count_missing trueor--pd_count_missing false. If true, will consider missing allele calls for the same locus between samples as a difference, increasing the distance counts.
Other
Other parameters (defaults from nf-core) are defined in nextflow_schema.json.
Running
To run the pipeline, please do:
bash
nextflow run phac-nml/fastmatchirida -profile singularity -r main -latest --input https://github.com/phac-nml/fastmatchirida/raw/dev/assets/samplesheet.csv --outdir results
Where the samplesheet.csv is structured as specified in the Input section.
Output
A JSON file for loading metadata into IRIDA Next is output by this pipeline. The format of this JSON file is specified in our Pipeline Standards for the IRIDA Next JSON. This JSON file is written directly within the --outdir provided to the pipeline with the name iridanext.output.json.gz (ex: [outdir]/iridanext.output.json.gz).
An example of the what the contents of the IRIDA Next JSON file looks like for this particular pipeline is as follows:
``` { "files": { "global": [ { "path": "pipelineinfo/softwareversions.yml" }, { "path": "process/results.xlsx" }, { "path": "process/results.tsv" }, { "path": "distances/profiledists.run.json" }, { "path": "distances/profiledists.results.tsv" }, { "path": "distances/profiledists.refprofile.tsv" }, { "path": "distances/profiledists.queryprofile.tsv" }, { "path": "distances/profiledists.allelemap.json" }, { "path": "locidex/concat/query/MLSTerrorreportconcatquery.csv" }, { "path": "locidex/concat/reference/MLSTerrorreportconcatref.csv" } ], "samples": {
}
},
"metadata": {
"samples": {
}
}
} ```
Within the files section of this JSON file, all of the output paths are relative to the outdir. Therefore, "path": "process/results.xlsx" refers to a file located within outdir/process/results.xlsx.
Details on the individual output files can be found in the Output Documentation.
Test Profile
To run with the test profile, please do:
bash
nextflow run phac-nml/fastmatchirida -profile docker,test -r main -latest --outdir results
Legal
Copyright 2024 Government of Canada
Licensed under the MIT License (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License at:
https://opensource.org/license/mit/
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Owner
- Name: National Microbiology Laboratory
- Login: phac-nml
- Kind: organization
- Website: https://www.nml-lnm.gc.ca/
- Repositories: 50
- Profile: https://github.com/phac-nml
Citation (CITATIONS.md)
# phac-nml/fastmatchirida: Citations ## [nf-core](https://pubmed.ncbi.nlm.nih.gov/32055031/) > Ewels PA, Peltzer A, Fillinger S, Patel H, Alneberg J, Wilm A, Garcia MU, Di Tommaso P, Nahnsen S. The nf-core framework for community-curated bioinformatics pipelines. Nat Biotechnol. 2020 Mar;38(3):276-278. doi: 10.1038/s41587-020-0439-x. PubMed PMID: 32055031. ## [Nextflow](https://pubmed.ncbi.nlm.nih.gov/28398311/) > Di Tommaso P, Chatzou M, Floden EW, Barja PP, Palumbo E, Notredame C. Nextflow enables reproducible computational workflows. Nat Biotechnol. 2017 Apr 11;35(4):316-319. doi: 10.1038/nbt.3820. PubMed PMID: 28398311. ## Pipeline tools - [locidex](https://github.com/phac-nml/locidex) (in-development, citation subject to change) > Robertson, James, Wells, Matthew, Christy-Lynn, Peterson, Kyrylo Bessonov, Reimer, Aleisha, Schonfeld, Justin. LOCIDEX: Distributed allele calling engine. 2024. https://github.com/phac-nml/locidex - [profile_dists](https://github.com/phac-nml/profile_dists) (in-development, citation subject to change) > Robertson, James, Wells, Matthew, Schonfeld, Justin, Reimer, Aleisha. Profile Dists: Convenient package for comparing genetic similarity of samples based on allelic profiles. 2023. https://github.com/phac-nml/profile_dists - [genomic_address_service (GAS)](https://github.com/phac-nml/genomic_address_service) (in-development, citation subject to change) > Robertson, James, Wells, Matthew, Schonfeld, Justin, Reimer, Aleisha. Genomic Address Service: Convenient package for de novo clustering and sample assignment to existing clusters. 2023. https://github.com/phac-nml/genomic_address_service - [ArborView (included in repository)](https://github.com/phac-nml/fastmatchirida/blob/dev/assets/ArborView.html) (in-development, citation subject to change) ## Software packaging/containerisation tools - [Anaconda](https://anaconda.com) > Anaconda Software Distribution. Computer software. Vers. 2-2.4.0. Anaconda, Nov. 2016. Web. - [Bioconda](https://pubmed.ncbi.nlm.nih.gov/29967506/) > Grüning B, Dale R, Sjödin A, Chapman BA, Rowe J, Tomkins-Tinch CH, Valieris R, Köster J; Bioconda Team. Bioconda: sustainable and comprehensive software distribution for the life sciences. Nat Methods. 2018 Jul;15(7):475-476. doi: 10.1038/s41592-018-0046-7. PubMed PMID: 29967506. - [BioContainers](https://pubmed.ncbi.nlm.nih.gov/28379341/) > da Veiga Leprevost F, Grüning B, Aflitos SA, Röst HL, Uszkoreit J, Barsnes H, Vaudel M, Moreno P, Gatto L, Weber J, Bai M, Jimenez RC, Sachsenberg T, Pfeuffer J, Alvarez RV, Griss J, Nesvizhskii AI, Perez-Riverol Y. BioContainers: an open-source and community-driven framework for software standardization. Bioinformatics. 2017 Aug 15;33(16):2580-2582. doi: 10.1093/bioinformatics/btx192. PubMed PMID: 28379341; PubMed Central PMCID: PMC5870671. - [Docker](https://dl.acm.org/doi/10.5555/2600239.2600241) > Merkel, D. (2014). Docker: lightweight linux containers for consistent development and deployment. Linux Journal, 2014(239), 2. doi: 10.5555/2600239.2600241. - [Singularity](https://pubmed.ncbi.nlm.nih.gov/28494014/) > Kurtzer GM, Sochat V, Bauer MW. Singularity: Scientific containers for mobility of compute. PLoS One. 2017 May 11;12(5):e0177459. doi: 10.1371/journal.pone.0177459. eCollection 2017. PubMed PMID: 28494014; PubMed Central PMCID: PMC5426675.
GitHub Events
Total
- Create event: 32
- Issues event: 4
- Release event: 8
- Watch event: 1
- Delete event: 19
- Issue comment event: 27
- Member event: 1
- Push event: 130
- Pull request review comment event: 38
- Pull request event: 47
- Pull request review event: 56
Last Year
- Create event: 32
- Issues event: 4
- Release event: 8
- Watch event: 1
- Delete event: 19
- Issue comment event: 27
- Member event: 1
- Push event: 130
- Pull request review comment event: 38
- Pull request event: 47
- Pull request review event: 56
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 2
- Total pull requests: 26
- Average time to close issues: 4 days
- Average time to close pull requests: 1 day
- Total issue authors: 1
- Total pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 1.12
- Merged pull requests: 23
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 26
- Average time to close issues: 4 days
- Average time to close pull requests: 1 day
- Issue authors: 1
- Pull request authors: 2
- Average comments per issue: 0.0
- Average comments per pull request: 1.12
- Merged pull requests: 23
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- sgsutcliffe (2)
Pull Request Authors
- sgsutcliffe (17)
- emarinier (9)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- mshick/add-pr-comment b8f338c590a895d50bcbfa6c5859251edc8952fc composite
- actions/cache v3 composite
- actions/checkout b4ffde65f46336ab88eb53be808477a3936bae11 composite
- nf-core/setup-nextflow v1 composite
- actions/checkout 0ad4b8fadaa221de15dcec353f45205ec38ea70b composite
- actions/setup-python 82c7e631bb3cdc910f68e0081d67478d79c6982d composite
- actions/upload-artifact 65462800fd760344b1a7b4382951275a0abb4808 composite
- nf-core/setup-nextflow v2 composite
- pietrobolcato/action-read-yaml 1.1.0 composite
- dawidd6/action-download-artifact bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 composite
- marocchino/sticky-pull-request-comment 331f8f5b4215f0445d3c07b4967662a32a2d3e31 composite