mgkit.io.snpdat module

SNPDat reader

class mgkit.io.snpdat.SNPDatRow(line=None, rev_comp=None)[source]

Bases: object

Class containing information ouputted by SNPDat in its result file. One instance contains information about a row in the file.

chr_name

the queried SNPs chromosome ID

Type:str
chr_pos

queried SNPs genomic location

Type:int
in_feat

Whether or not the queried SNP was within a feature

Type:bool
region

Region containing the SNP; either exonic, intronic or intergenic

Type:str
feat_dist

Distance to nearest feature

Type:int
feature

Either the closest feature to the SNP or the feature containing the SNP

Type:str
num_features

number of different features that the SNP is annotated to

Type:int
feat_num

number of annotations of the current feature

Type:int
feat_start

Start of feature (bp)

Type:int
feat_end

End of feature (bp)

Type:int
gene_id

gene ID for the current feature

Type:str
gene_name

gene name for the current feature

Type:str
transcript_id

transcript ID for the current feature

Type:str
transcript_name

transcript name for the current feature

Type:str
exon

exon that contains the current feature and the total number of annotated exons for the gene containing the feature

Type:tuple
strand

strand sense of the feature

Type:str
ann_frame

annotated reading frame (when contained in the GTF)

Type:str
frame

reading frame estimated by SNPdat

Type:str
num_stops

estimated number of stop codons in the estimated reading frame

Type:int
codon

codon containing the SNP, position in the codon and reference base and mutation

Type:tuple
nuc_change

amino acid for the reference codon and new amino acid with the mutation in place

Type:tuple
nuc_ref

reference nucleotide

Type:str, None
aa_change

amino acid for the reference codon and new amino acid with the mutation in place

Type:str
synonymous

Whether or not the mutation is synonymous

Type:bool
protein_id

protein ID for the current feature

Type:str
messages

messages in the SNPDat line

Type:str
aa_change
ann_frame
chr_name
chr_pos
codon
exon
feat_dist
feat_end
feat_num
feat_start
feature
frame
gene_id
gene_name
in_feat
messages
nuc_change
nuc_ref
num_features
num_stops
protein_id
region
strand
synonymous
transcript_id
transcript_name
mgkit.io.snpdat.snpdat_reader(f_handle)[source]

Simple SNPDat reader.

f_handle: file handle or string for the SNPDat result file

Returns:generator of SNPDatRow instances