Package: pygas
pyGaSpython Guide aligned SequencesDocker and SingularityCommand exampleInputsOutput formatDevelopmentInstallTestingLocalvenvtestingLocalpre-commithooksDocker testingCI testsUpdating licence headersLICENSEDocker and SingularityThere are pre-built images containing this codebase onquay.io.  When pulling an image you must specify
the version there is nolatest.The docker images are known to work correctly after import into a singularity image.Command exampleThe code is intended to be used as an API, not through this command line, however limited use is possible.pygasrun-texamples/targets.txt.gz-qexamples/queries.txt.gz-oyour_result.tsvInputsqueries.txtA unique list of sequences (for performance reasons), one per lineThis could be reworked to handle internally, however memory is a considerationMatching sequences back to real input data and related information would be the responsibility of wrapping codetargets.txtOne target sequence per lineReverse compliment is handled automatically, see output format.Targets need to be unique during mapping, expand out for things like dual guide permutations in your applicationOutput formatVery simple text output of values that are available in API:#query	reversed	t_id	t_pos	cigar	seq	md	repeat_2-7...
AAAAATCGCTGCTACAGGT	False	48566	1	AAAAATCGCTGCTACAGGT	M19	19
CTGGTCTCGCACCCCAGGC	False	65601	1	CTGGTCTCGCACCCCAGGC	M19	18T
GGCGCGGTACTTGCCCAGA	False	34773	1	GGCGCGGTACTTGCCCAGA	S1M18	18
AAAAAAAAAAAAAAAAAAA	False	0	1	AAAAAAAAAAAAAAAAAAA	M19	19	True	1	1	TTTTTTTTTTTTTTTTTTT	M19	19
...Where:ColumnDescriptionInterpretationqueryOriginal query sequencereversedRead was reversed to match the targetfollowing fields are based on this orientationt_idID of target mapped to0-based numbering in order targets passedt_posStart position within target sequence1-basedseqQuery in mapped orientationCorresponds tocigarandmdorientationcigarcigarstring for use in SAM like filesFor details see theSAM specificationmdMDstring for use in SAM like filesFor details see theSAM optional field specificationDevelopmentInstallpython3-mvenvvenvsourcevenv/bin/activate
pipinstall-rrequirements.txt
python3setup.pydevelop# see laterpre-commitinstall# remember to update requirementspipfreeze|grep-vvirtualenv>requirements.txtTestingThere are 4 layers to testing and standards:LocalvenvtestingLocalpre-commithooksTests embedded indocker buildCItestsLocalvenvtesting/tests/scripts/run_unit_tests.shLocalpre-commithooksThis project additionally uses git pre-commit hooks via thepre-commit tool.  These are concerned
with file formats and standards, not the actual execution of code.  See./.pre-commit-config.yaml.Docker testingThe Docker build includes the unit tests, but removes many of the libraries before the final build stage.  Mainly for CI tests.CI testsCI includes 2 additional tests, each based on the 2 datasets in the./examplesdirectory.Updating licence headersPlease useskywalking-eyes.Expected workflow:Check state before modifying.licenserc.yaml:docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header checkYou should get some 'valid' here, those without a header as 'invalid'Modify.licenserc.yamlApply the changes:docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fixAdd/commit changesThis is executed in the CI pipeline.DO NOTedit the header in the files, please modify the date component ofcontentin.licenserc.yaml.  The exceptions being:README.mdpygas/matrix.pycYou will need to manually update, but the checks will accept it once updatedIf you need to make more extensive changes to the license carefully test the pattern is functional.LICENSECopyright (c) 2021

Author: CASM/Cancer IT <cgphelp@sanger.ac.uk>

This file is part of pygas.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

1. The usage of a range of years within a copyright statement contained within
this distribution should be interpreted as being equivalent to a list of years
including the first and last year specified and all consecutive years between
them. For example, a copyright statement that reads ‘Copyright (c) 2005, 2007-
2009, 2011-2012’ should be interpreted as being identical to a statement that
reads ‘Copyright (c) 2005, 2007, 2008, 2009, 2011, 2012’ and a copyright
statement that reads ‘Copyright (c) 2005-2012’ should be interpreted as being
identical to a statement that reads ‘Copyright (c) 2005, 2006, 2007, 2008,
2009, 2010, 2011, 2012’.