Package: seqann
Python package for annotating gene featuresFree software: LGPL 3.0Documentation:https://seqann.readthedocs.io.Jupyter NotebookOverviewTheseqannpackage allows
users to annotate gene features in consensus sequences. Annotations can be created by passing consensus sequences to theannotatemethod in theBioSeqAnnclass. No parameters are required when initalizing aBioSeqAnnclass. However, annotations can be
created significantly faster when using a BioSQL database. When a BioSQL database is not provided the lastesthla.datfile is downloaded and parsed.
A BioSQL database containing all of IPD-IMGT/HLA is available onDockerHuband can be
run on any machine that has docker installed.ParametersBelow are the list of parameters and the default values used when initalizing aBioSeqAnnobject.ParameterTypeDefaultDescriptionserverBioSeqDatabaseNoneA BioSQL database containing all of the sequence data from IPD-IMGT/HLA.dbversionstrLatestThe IPD-IMGT/HLA or KIR database release.datfilestrNoneThe IPD-IMGT/HLA or KIR dat file to use in place of theserverparameter.kirboolFalseFlag for indicating the input sequences are from the KIR gene system.alignboolFalseFlag for producing the alignments along with the annotations.verboseboolFalseFlag for running in verbose mode.verbosityintNoneNumerical value to indicate how verbose the output will be in verbose mode.debugDictNoneA dictionary containing a process names as the key and verbosity as the valueUsageTo annotated a sequence initialize a newBioSeqAnnobject and then pass the sequence to theannotatemethod. The sequence must be a BiopythonSeq. The locus of the sequence is not required but it will improve the accuracy of the annotation.fromseqannimportBioSeqAnnseqann=BioSeqAnn()ann=seqann.annotate(sequence,"HLA-A")The annotation of sequence can be done with or without providing aBioSeqDatabase. To use a BioSQL database
initialize aBioSeqDatabasewith the parameters that match the database you have running. If you are
running the imgt_biosqldb fromDockerHubthen the following parameters we be the same.fromseqannimportBioSeqAnnfromBioSQLimportBioSeqDatabaseserver=BioSeqDatabase.open_database(driver="pymysql",user="root",passwd="my-secret-pw",host="localhost",db="bioseqdb",port=3306)seqann=BioSeqAnn(server=server)ann=seqann.annotate(sequence,"HLA-A")Annotations{'complete_annotation':True,'annotation':{'exon_1':SeqRecord(seq=Seq('AGAGACTCTCCCG',SingleLetterAlphabet()),id='HLA:HLA00630',name='HLA:HLA00630',description='HLA:HLA00630 DQB1*03:04:01 597 bp',dbxrefs=[]),'exon_2':SeqRecord(seq=Seq('AGGATTTCGTGTACCAGTTTAAGGCCATGTGCTACTTCACCAACGGGACGGAGC...GAG',SingleLetterAlphabet()),id='HLA:HLA00630',name='HLA:HLA00630',description='HLA:HLA00630 DQB1*03:04:01 597 bp',dbxrefs=[]),'exon_3':SeqRecord(seq=Seq('TGGAGCCCACAGTGACCATCTCCCCATCCAGGACAGAGGCCCTCAACCACCACA...ATG',SingleLetterAlphabet()),id='HLA:HLA00630',name='<unknown name>',description='HLA:HLA00630',dbxrefs=[])},'features':{'exon_1':SeqFeature(FeatureLocation(ExactPosition(0),ExactPosition(13),strand=1),type='exon_1'),'exon_2':SeqFeature(FeatureLocation(ExactPosition(13),ExactPosition(283),strand=1),type='exon_2')'exon_3':SeqFeature(FeatureLocation(ExactPosition(283),ExactPosition(503),strand=1),type='exon_3')},'method':'nt_search and clustalo','gfe':'HLA-Aw2-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-4','seq':SeqRecord(seq=Seq('AGAGACTCTCCCGAGGATTTCGTGTACCAGTTTAAGGCCATGTGCTACTTCACC...ATG',SingleLetterAlphabet()),id='HLA:HLA00630',name='HLA:HLA00630',description='HLA:HLA00630 DQB1*03:04:01 597 bp',dbxrefs=[])}Once a sequence has been annotated the gene features and their corresponding sequences are available in the returnedAnnotationobject. If a full
annotation is not able to be produced then nothing will be returned. Below is an example showing how the features can be accessed and printed out.ann=seqann.annotate(sequence,"HLA-A")forfeatinann.annotation:print(feat,ann.gfe,str(ann.annotation[feat].seq),sep="\t")InstallpipinstallseqannDependenciesClustal Omega1.2.0 or higherPython 3.6blastn