pytximport.importers ==================== .. py:module:: pytximport.importers .. autoapi-nested-parse:: Importing functions for different transcript quantification tools. Functions contained within this module are primarily destined for internal use but are exposed for advanced users who may want to use them directly. Functions --------- .. autoapisummary:: pytximport.importers.parse_dataframe pytximport.importers.read_inferential_replicates_kallisto pytximport.importers.read_inferential_replicates_piscem pytximport.importers.read_inferential_replicates_salmon pytximport.importers.read_kallisto pytximport.importers.read_piscem pytximport.importers.read_rsem pytximport.importers.read_salmon pytximport.importers.read_tsv Package Contents ---------------- .. py:function:: parse_dataframe(transcript_dataframe, id_column, counts_column, length_column, abundance_column = None, recompute_counts = False) Parse a DataFrame with the transcript-level expression. :param transcript_dataframe: The DataFrame with the transcript-level expression. :type transcript_dataframe: pd.DataFrame :param id_column: The column name for the transcript id. :type id_column: str :param counts_column: The column name for the counts. :type counts_column: str :param length_column: The column name for the length. :type length_column: str :param abundance_column: The column name for the abundance. Defaults to None. :type abundance_column: Optional[str], optional :param recompute_counts: Whether inferential replicates will be used to recompute counts and abundances. If true, the counts and abundances will not be read from the file. Defaults to False. :type recompute_counts: bool, optional :returns: The transcript-level expression. :rtype: TranscriptData .. py:function:: read_inferential_replicates_kallisto(file_path) Read inferential replicates from a kallisto quantification file. :param file_path: The path to the quantification file. :type file_path: Union[str, Path] :returns: The inferential replicates. :rtype: InferentialReplicates .. py:function:: read_inferential_replicates_piscem(file_path) Read inferential replicates from a piscem quantification file. :param file_path: The path to the quantification file. The file should be a .quant file that is colocated with the inferential replicates file (.infreps.pq). :type file_path: Union[str, Path] :returns: The inferential replicates. :rtype: InferentialReplicates .. py:function:: read_inferential_replicates_salmon(file_path, aux_dir_name = 'aux_info') Read inferential replicates from a salmon quantification file. :param file_path: The path to the quantification file. :type file_path: Union[str, Path] :param aux_dir_name: The name of the aux directory. Defaults to "aux_info". :type aux_dir_name: Literal["aux_info", "aux"], optional :returns: The inferential replicates. :rtype: InferentialReplicates .. py:function:: read_kallisto(file_path, id_column = 'aux/ids', counts_column = 'est_counts', length_column = 'aux/eff_lengths', abundance_column = None, inferential_replicates = False, recompute_counts = False) Read a kallisto quantification file. :param file_path: The path to the quantification file. :type file_path: Union[str, Path] :param id_column: The column name for the transcript id. Defaults to "aux/ids". :type id_column: str, optional :param counts_column: The column name for the counts. Defaults to "est_counts". :type counts_column: str, optional :param length_column: The column name for the length. Defaults to "aux/eff_lengths". :type length_column: str, optional :param abundance_column: The column name for the abundance. Defaults to None. :type abundance_column: Optional[str], optional :param inferential_replicates: Whether to read inferential replicates. Defaults to False. :type inferential_replicates: bool, optional :param recompute_counts: Whether inferential replicates will be used to recompute counts and abundances. If true, the counts and abundances will not be read from the file. Defaults to False. :type recompute_counts: bool, optional :returns: The transcript-level expression. :rtype: TranscriptData .. py:function:: read_piscem(file_path, id_column = 'target_name', counts_column = 'ecount', length_column = 'eeln', abundance_column = 'tpm', inferential_replicates = False, recompute_counts = False) Read a piscem-infer quantification file. :param file_path: The path to the quantification file. :type file_path: Union[str, Path] :param id_column: The column name for the transcript id. Defaults to "Name". :type id_column: str, optional :param counts_column: The column name for the counts. Defaults to "NumReads". :type counts_column: str, optional :param length_column: The column name for the length. Defaults to "EffectiveLength". :type length_column: str, optional :param abundance_column: The column name for the abundance. Defaults to "TPM". :type abundance_column: str, optional :param aux_dir_name: The name of the aux directory. Defaults to "aux_info". :type aux_dir_name: Literal["aux_info", "aux"], optional :param inferential_replicates: Whether to read inferential replicates. Defaults to False. :type inferential_replicates: bool, optional :param recompute_counts: Whether inferential replicates will be used to recompute counts and abundances. If true, the counts and abundances will not be read from the file. Defaults to False. :type recompute_counts: bool, optional :returns: The transcript-level expression. :rtype: TranscriptData .. py:function:: read_rsem(file_path, id_column = 'transcript_id', counts_column = 'expected_count', length_column = 'effective_length', abundance_column = 'TPM', gene_level = False) Read an RSEM quantification file. :param file_path: The path to the quantification file. :type file_path: Union[str, Path] :param id_column: The column name for the transcript ID. Defaults to "transcript_id". :type id_column: str, optional :param counts_column: The column name for the counts. Defaults to "expected_count". :type counts_column: str, optional :param length_column: The column name for the length. Defaults to "effective_length". :type length_column: str, optional :param abundance_column: The column name for the abundance. Defaults to "TPM". :type abundance_column: str, optional :param gene_level: Whether the quantification is at the gene level. Defaults to False. :type gene_level: bool, optional :returns: The transcript-level expression. :rtype: TranscriptData .. py:function:: read_salmon(file_path, id_column = 'Name', counts_column = 'NumReads', length_column = 'EffectiveLength', abundance_column = 'TPM', aux_dir_name = 'aux_info', inferential_replicates = False, recompute_counts = False) Read a salmon quantification file. :param file_path: The path to the quantification file. :type file_path: Union[str, Path] :param id_column: The column name for the transcript id. Defaults to "Name". :type id_column: str, optional :param counts_column: The column name for the counts. Defaults to "NumReads". :type counts_column: str, optional :param length_column: The column name for the length. Defaults to "EffectiveLength". :type length_column: str, optional :param abundance_column: The column name for the abundance. Defaults to "TPM". :type abundance_column: str, optional :param aux_dir_name: The name of the aux directory. Defaults to "aux_info". :type aux_dir_name: Literal["aux_info", "aux"], optional :param inferential_replicates: Whether to read inferential replicates. Defaults to False. :type inferential_replicates: bool, optional :param recompute_counts: Whether inferential replicates will be used to recompute counts and abundances. If true, the counts and abundances will not be read from the file. Defaults to False. :type recompute_counts: bool, optional :returns: The transcript-level expression. :rtype: TranscriptData .. py:function:: read_tsv(file_path, id_column, counts_column, length_column, abundance_column = None, recompute_counts = False) Read a quantification file in tsv format. :param file_path: The path to the quantification file. :type file_path: Union[str, Path] :param id_column: The column name for the transcript id. :type id_column: str :param counts_column: The column name for the counts. :type counts_column: str :param length_column: The column name for the length. :type length_column: str :param abundance_column: The column name for the abundance. Defaults to None. :type abundance_column: Optional[str], optional :param recompute_counts: Whether inferential replicates will be used to recompute counts and abundances. If true, the counts and abundances will not be read from the file. Defaults to False. :type recompute_counts: bool, optional :returns: The transcript-level expression. :rtype: TranscriptData