Annotation parsers
AnnotationMatrixParser
¶
Bases: object
A generic annotation matrix parser class.
Source code in magenpy/parsers/annotation_parsers.py
__init__(col_name_converter=None, **read_csv_kwargs)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
col_name_converter
|
A dictionary mapping column names in the original table to magenpy's column names for the various SNP features in the annotation matrix. |
None
|
|
read_csv_kwargs
|
Keyword arguments to pass to pandas' |
{}
|
Source code in magenpy/parsers/annotation_parsers.py
parse(annotation_file, drop_na=True)
¶
Parse the annotation matrix file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
annotation_file
|
The path to the annotation file. |
required | |
drop_na
|
Drop any entries with missing values. |
True
|
Source code in magenpy/parsers/annotation_parsers.py
LDSCAnnotationMatrixParser
¶
Bases: AnnotationMatrixParser
Source code in magenpy/parsers/annotation_parsers.py
__init__(col_name_converter=None, **read_csv_kwargs)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
col_name_converter
|
A dictionary mapping column names in the original table to magenpy's column names for the various SNP features in the annotation matrix. |
None
|
|
read_csv_kwargs
|
Keyword arguments to pass to pandas' read_csv |
{}
|
Source code in magenpy/parsers/annotation_parsers.py
parse(annotation_file, drop_na=True)
¶
Parse the annotation matrix file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
annotation_file
|
The path to the annotation file. |
required | |
drop_na
|
Drop any entries with missing values. |
True
|
Source code in magenpy/parsers/annotation_parsers.py
parse_annotation_bed_file(annot_bed_file)
¶
Parse an annotation bed file in the format specified by Ensemble: https://uswest.ensembl.org/info/website/upload/bed.html
The file contains 3-12 columns, starting with Chromosome, start_coordinate, end_coordinate, etc. After reading the raw file, we let pandas infer whether the file has a header or not and we standardize the names of the first 3 columns and convert the chromosome column into an integer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
annot_bed_file
|
str
|
The path to the annotation BED file. |
required |