This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Slices/subsections genbank files by either gene names or base pair range. This handles multi-genbank files which have multiple contigs | |
# Usage: | |
# slice_multi_genbank.py -i infile.gbk -g gene1:gene2 -o gene_sliced_output.gbk # This will extract the region between two genes including these genes | |
# slice_multi_genbank.py -i infile.gbk -g gene1:gene2 -n 2 -o gene_sliced_output.gbk # This will extract 2 genes up- and down-stream of your specified two genes | |
# slice_multi_genbank.py -i infile.gbk -g gene1: -o gene_extract_output.gbk # This will extract a single gene | |
# slice_multi_genbank.py -i infile.gbk -g gene1: -n 3 -o gene_extract_output.gbk # This will extract a single gene and 3 genes up- and down-stream of the gene | |
# slice_multi_genbank.py -i infile.gbk -r start:end:contig -o range_sliced_output.gbk # This will slice via base pair range and locus/contig. This is required to handle multi-genbank files |