Finalreport package
The module that performs/parsing file FinalReport.txt file.
- class snplib.finalreport.FinalReport(allele: str | list | None = None, sep: str = '\t')[source]
Bases:
objectFile that contains SNP information.
- Parameters:
allele – A variant form of a single nucleotide polymorphism (SNP), a specific polymorphic site or a whole gene detectable at a locus. Type: ‘AB’, ‘Forward’, ‘Top’, ‘Plus’, ‘Design’
sep – Delimiter to use. Default value: “t”
Example
[Header] GSGT Version 2.0.4 Processing Date 10/14/2021 4:02 PM Content BovineSNP50_v3_A1.bpm Num SNPs 53218 Total SNPs 53218 Num Samples 3 Total Samples 3 [Data] SNP Name Sample ID Allele1 - AB Allele2 - AB GC Score GT Score ABCA12 1 A A 0.4048 0.8164 APAF1 1 B B 0.9067 0.9155 …
- __PATTERN_DATA = re.compile('(^\\[Data\\])')
- __PATTERN_HEADER = re.compile('(^\\[Header\\])')
- __convert_s_id(path_file: Path) None
Converts sample id which is in FinalReport to animal registration number.
- Parameters:
path_file – xlsx file with animal numbers label
- __handler_data() None
Processes data and forms an array for further processing.
- __handler_header() None
Processes data from a file, selects meta-information.
- __sample_by_allele(names: list[str]) list[str] | None
Method that generates a list of field names choosing which alleles to keep
- Parameters:
names – List of field names in the report file.
- Returns:
Returns a filtered list of fields by alleles.
- handle(file_rep: Path | str, conv_file: Path | str = None) bool[source]
Processes the FinalReport.txt file. Highlights meta information and data.
- Parameters:
file_rep – The file FinalReport.txt or another name.
conv_file – The file that contains IDs of registration numbers of animals.
- Returns:
Returns true if file processing was successful, false if there were errors.
- property header: dict
- read(file_rep: Path) bool[source]
Reading data from the final_report file
- Parameters:
file_rep – path, pointer to the file to be read.
- Returns:
Returns true if the read was successful, false if it failed.
- property snp_data: DataFrame | None