Esempio n. 1
0
 def test_extractNamesAndIntensities_single(self):
     intensities_single = self.intensities_single
     feature_dir = (current_dir +
                    "/test_data/FIA_MS_Data/features_AdditionalAdducts")
     sequence_single = pd.read_csv(
         current_dir + "/test_data/FIA_MS_Data/sequence_HumanSerum.csv",
         sep=";")
     sample_names_single = sequence_single["sample_group_name"].unique()
     database_single = pd.read_csv(
         current_dir + "/test_data/FIA_MS_Data/CHEMISTRY/HMDB_struct.tsv",
         sep="\t",
         header=None,
     )
     intensities_single_ = fia_ms.extractNamesAndIntensities(
         feature_dir, sample_names_single, database_single)
     self.assertEqual(len(intensities_single), len(intensities_single_))
     self.assertEqual(len(intensities_single.columns),
                      len(intensities_single_.columns))
     self.assertEqual(intensities_single, intensities_single_)
Esempio n. 2
0
 def test_extractNamesAndIntensities_standard(self):
     intensities_standard = self.intensities_standard
     feature_dir = (current_dir +
                    "/test_data/FIA_MS_Data/features_AdditionalAdducts")
     sequence_standard = pd.read_csv(
         current_dir + "/test_data/FIA_MS_Data/sequence_Standards.csv",
         sep=";")
     sample_names_standard = sequence_standard["sample_group_name"].unique()
     database_standard = pd.read_csv(
         current_dir +
         "/test_data/FIA_MS_Data/CHEMISTRY/standard_mix_struct.tsv",
         sep="\t",
         header=None,
     )
     intensities_standard_ = fia_ms.extractNamesAndIntensities(
         feature_dir, sample_names_standard, database_standard)
     self.assertEqual(len(intensities_standard), len(intensities_standard_))
     self.assertEqual(len(intensities_standard.columns),
                      len(intensities_standard_.columns))
     self.assertEqual(intensities_standard, intensities_standard_)
Esempio n. 3
0
 def test_extractNamesAndIntensities_triplicates(self):
     intensities_triplicates = self.intensities_triplicates
     feature_dir = (current_dir +
                    "/test_data/FIA_MS_Data/features_AdditionalAdducts")
     sequence_triplicates = pd.read_csv(
         current_dir + "/test_data/FIA_MS_Data/sequence_EColi.csv", sep=";")
     sample_names_triplicates = sequence_triplicates[
         "sample_group_name"].unique()
     database_triplicates = pd.read_csv(
         current_dir +
         "/test_data/FIA_MS_Data/CHEMISTRY/iJO1366_struct.tsv",
         sep="\t",
         header=None,
     )
     intensities_triplicates_ = fia_ms.extractNamesAndIntensities(
         feature_dir, sample_names_triplicates, database_triplicates)
     self.assertEqual(len(intensities_triplicates),
                      len(intensities_triplicates_))
     self.assertEqual(
         len(intensities_triplicates.columns),
         len(intensities_triplicates_.columns),
     )
     self.assertEqual(intensities_triplicates, intensities_triplicates_)
Esempio n. 4
0
                              sep=";")
sample_names_single = sequence_single["sample_group_name"].unique()
database_single = pd.read_csv(current_dir + "/../CHEMISTRY/HMDB_struct.tsv",
                              sep="\t",
                              header=None)
sequence_standard = pd.read_csv(current_dir + "/../sequence_Standards.csv",
                                sep=";")
sample_names_standard = sequence_standard["sample_group_name"].unique()
database_standard = pd.read_csv(
    current_dir + "/../CHEMISTRY/standard_mix_struct.tsv",
    sep="\t",
    header=None,
)

# extractNamesAndIntensities, triplicates
intensities_triplicates = fia_ms.extractNamesAndIntensities(
    feature_dir, sample_names_triplicates, database_triplicates)
intensities_single = fia_ms.extractNamesAndIntensities(feature_dir,
                                                       sample_names_single,
                                                       database_single)
intensities_standard = fia_ms.extractNamesAndIntensities(
    feature_dir, sample_names_standard, database_standard)

# calculateMeanVarRSD
stats_triplicates = fia_ms.calculateMeanVarRSD(
    intensities_triplicates,
    sequence_triplicates.drop_duplicates(
        ["sample_group_name", "replicate_group_name"]),
    min_reps=3,
)
stats_single = fia_ms.calculateMeanVarRSD(
    intensities_single,