snipit

snipit: summarise snps relative to your reference sequence

https://github.com/aineniamh/snipit

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    3 of 7 committers (42.9%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.4%) to scientific vocabulary

Keywords from Contributors

sequences
Last synced: 10 months ago · JSON representation

Repository

snipit: summarise snps relative to your reference sequence

Basic Info
  • Host: GitHub
  • Owner: aineniamh
  • License: gpl-3.0
  • Language: Python
  • Default Branch: master
  • Size: 406 KB
Statistics
  • Stars: 164
  • Watchers: 3
  • Forks: 30
  • Open Issues: 10
  • Releases: 2
Created almost 6 years ago · Last pushed about 1 year ago
Metadata Files
Readme License

README.md

snipit

Summarise snps relative to a reference sequence

Install

pip install snipit

Example Usage

Link to test data: test.fasta and aa_test.fasta

  • Basic usage for nucleotide alignments: snipit test.fasta \ --output-file test Default format output is png. Only specify output path/name (not extension).

  • To change output format, use --format: snipit test.fasta \ --output-file test \ --format pdf Options: png, jpg, pdf, svg, tiff.

  • To change color scheme, use --colour-palette: snipit test.fasta \ --output-file test \ --colour-palette classic_extended

Other colours schemes: classic, classic_extended, primary, purine-pyrimidine, greyscale, wes,verity, ugene Use ugene for protein (aa) alignments. Use classic_extended for colouring ambiguous bases.

  • There are multiple options to control which SNPs or indels are included/excluded: snipit test.fasta \ --show-indels \ --include-positions '100-150' \ --exclude-positions '223 224 225'

  • For control over ambiguous bases, use --ambig-mode to specify how ambiguous bases are handled: [all] include all ambig such as N,Y,B in all positions [snps] only include ambig if a snp is present at the same position - Default [exclude] remove all ambig, same as depreciated --exclude-ambig-pos Use the colour palette classic_extended when plotting with all or snps.

    • Recombination mode is designed to assist with recombination analysis for SC2. This mode allows for colouring of mutations present in two references. For recombination mode, three flags are required: --reference,--recombi-mode,--recombi-references.

The specified --reference must be different from the --recombi-references. snipit test.fasta \ --reference USA_3 \ --recombi-mode \ --recombi-references "USA_1,USA_2"

For amino acid alignments, specify the sequence type as aa, use the colour palette ugene: snipit test.prot.fasta \ --sequence-type aa \ --colour-palette ugene \ --output-file test.prot

There are several more options, see below for full usage.

Issues

If you see an error like: ModuleNotFoundError: No module named 'pkg_resources' This may mean your python install did not come with setuptools. Install setuptools and this should resolve the issue.

Full Usage

``` snipit

optional arguments: -h, --help show this help message and exit

Input options: alignment Input alignment fasta file -t {nt,aa}, --sequence-type {nt,aa} Input sequence type: aa or nt -r REFERENCE, --reference REFERENCE Indicates which sequence in the alignment is the reference (by sequence ID). Default: first sequence in alignment -l LABELS, --labels LABELS Optional csv file of labels to show in output snipit plot. Default: sequence names --l-header LABEL_HEADERS Comma separated string of column headers in label csv. First field indicates sequence name column, second the label column. Default: 'name,label'

Mode options: --recombi-mode Allow colouring of query seqeunces by mutations present in two 'recombi-references' from the input alignment fasta file --recombi-references RECOMBIREFERENCES Specify two comma separated sequence IDs in the input alignment to use as 'recombi-references'. Ex. SequenceIDA,SequenceID_B --cds-mode Assumes sequence supplied is a coding sequence

Output options: -d OUTPUTDIR, --output-dir OUTPUTDIR Output directory. Default: current working directory -o OUTFILE, --output-file OUTFILE Output file name stem. Default: snp_plot -s, --write-snps Write out the SNPs in a csv file. -f FORMAT, --format FORMAT Format options (png, jpg, pdf, svg, tiff) Default: png

Figure options: --height HEIGHT Overwrite the default figure height --width WIDTH Overwrite the default figure width --size-option SIZEOPTION Specify options for sizing. Options: expand, scale --solid-background Force the plot to have a solid background, rather than a transparent one. -c , --colour-palette Specify colour palette. Options: [classic, classicextended, primary, purine-pyrimidine, greyscale, wes, verity, ugene]. Use ugene for protein alignments. --flip-vertical Flip the orientation of the plot so sequences are below the reference rather than above it. --sort-by-mutation-number Render the graph with sequences sorted by the number of SNPs relative to the reference (fewest to most). Default: False --sort-by-id Sort sequences alphabetically by sequence id. Default: False --sort-by-mutations SORTBYMUTATIONS Sort sequences by bases at specified positions. Positions are comma separated integers. Ex. '1,2,3' --high-to-low If sorted by mutation number is selected, show the sequences with the fewest SNPs closest to the reference. Default: False

SNP options: --show-indels Include insertion and deletion mutations in snipit plot. --include-positions INCLUDEDPOSITIONS [INCLUDEDPOSITIONS ...] One or more range (closed, inclusive; one-indexed) or specific position only included in the output. Ex. '100-150' or Ex. '100 101' Considered before '-- exclude-positions'. --exclude-positions EXCLUDEDPOSITIONS [EXCLUDEDPOSITIONS ...] One or more range (closed, inclusive; one-indexed) or specific position to exclude in the output. Ex. '100-150' or Ex. '100 101' Considered after '-- include-positions'. --ambig-mode {all,snps,exclude} Controls how ambiguous bases are handled - [all] include all ambig such as N,Y,B in all positions; [snps] only include ambig if a snp is present at the same position; [exclude] remove all ambig, same as depreciated --exclude-ambig-pos

Misc options: -v, --version show program's version number and exit ```

Cite

Please cite this tool as follows: Aine O'Toole, snipit (2024) GitHub repository, https://github.com/aineniamh/snipit

Owner

  • Name: Áine O'Toole
  • Login: aineniamh
  • Kind: user
  • Location: Edinburgh
  • Company: University of Edinburgh

GitHub Events

Total
  • Create event: 2
  • Release event: 1
  • Issues event: 6
  • Watch event: 14
  • Issue comment event: 9
  • Push event: 4
  • Fork event: 4
Last Year
  • Create event: 2
  • Release event: 1
  • Issues event: 6
  • Watch event: 14
  • Issue comment event: 9
  • Push event: 4
  • Fork event: 4

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 108
  • Total Committers: 7
  • Avg Commits per committer: 15.429
  • Development Distribution Score (DDS): 0.222
Past Year
  • Commits: 7
  • Committers: 1
  • Avg Commits per committer: 7.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
aineniamh a****e@e****k 84
Ammar Aziz s****3@g****m 9
Christopher Tomkins-Tinch t****c@b****g 8
Matthew Watson m****n@o****a 3
Cornelius Roemer c****r@g****m 2
Wolfgang Maier m****w@i****e 1
Desperate-Dan d****e@t****e 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 31
  • Total pull requests: 17
  • Average time to close issues: 4 months
  • Average time to close pull requests: about 2 months
  • Total issue authors: 25
  • Total pull request authors: 8
  • Average comments per issue: 1.87
  • Average comments per pull request: 1.12
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 4
  • Pull requests: 0
  • Average time to close issues: about 1 month
  • Average time to close pull requests: N/A
  • Issue authors: 4
  • Pull request authors: 0
  • Average comments per issue: 1.75
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • corneliusroemer (3)
  • AntonioBaeza (2)
  • rebeelouise (2)
  • antoine4ucsd (2)
  • liamxg (2)
  • wm75 (1)
  • Rezwanuzzaman (1)
  • martinmchugh (1)
  • pmenzel (1)
  • Pseudomonas-fluorescens (1)
  • rambaut (1)
  • fabl96 (1)
  • clmattson (1)
  • sbridgett (1)
  • woguta (1)
Pull Request Authors
  • aineniamh (8)
  • ammaraziz (4)
  • tomkinsc (3)
  • corneliusroemer (2)
  • matt-sd-watson (1)
  • Desperate-Dan (1)
  • charlesfoster (1)
  • wm75 (1)
Top Labels
Issue Labels
bug (1) enhancement (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 3,415 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 4
  • Total versions: 14
  • Total maintainers: 1
pypi.org: snipit

snipit

  • Versions: 14
  • Dependent Packages: 0
  • Dependent Repositories: 4
  • Downloads: 3,415 Last month
  • Docker Downloads: 0
Rankings
Docker downloads count: 3.9%
Stargazers count: 7.3%
Dependent repos count: 7.5%
Average: 8.2%
Forks count: 8.5%
Dependent packages count: 10.1%
Downloads: 12.1%
Maintainers (1)
Last synced: 11 months ago

Dependencies

setup.py pypi
  • biopython >=1.70
  • matplotlib >=3.2.1
.github/workflows/snipit.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite