How to use the snps.snps.SNPs function in snps

To help you get started, we’ve selected a few snps examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apriha / snps / src / snps / snps_collection.py View on Github external
def _load_snps_helper(
        self,
        file,
        discrepant_snp_positions_threshold,
        discrepant_genotypes_threshold,
        save_output,
    ):
        logger.info("Loading {}".format(os.path.relpath(file)))
        discrepant_positions, discrepant_genotypes = self._add_snps(
            SNPs(file),
            discrepant_snp_positions_threshold,
            discrepant_genotypes_threshold,
            save_output,
        )

        self._discrepant_positions = self._discrepant_positions.append(
            discrepant_positions, sort=True
        )
        self._discrepant_genotypes = self._discrepant_genotypes.append(
            discrepant_genotypes, sort=True
        )
github apriha / snps / src / snps / snps_collection.py View on Github external
"""

import logging
import os

import numpy as np
import pandas as pd

from snps.snps import SNPs
from snps.utils import save_df_as_csv, clean_str

logger = logging.getLogger(__name__)


class SNPsCollection(SNPs):
    def __init__(self, raw_data=None, output_dir="output", name="", **kwargs):
        """ Object used to merge genotype / raw data files.

        Parameters
        ----------
        raw_data : list or str
            path(s) to file(s) with raw genotype data
        output_dir : str
            path to output directory
        name : str
            name for this ``SNPsCollection``
        """
        super().__init__(file="", output_dir=output_dir, **kwargs)

        self._source = []
        self._discrepant_positions_file_count = 0