Modules
            align_horizontally(canopus_file, gnps_file, gnps_mn_file, isdb_file, sirius_file, output=None)
¶
    CLI tool to align and merge data from CANOPUS, GNPS, Sirius, and ISDB horizontally.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| canopus_file | Optional[str] | Path to CANOPUS output file. | required | 
| gnps_file | Optional[str] | Path to GNPS output file. | required | 
| gnps_mn_file | Optional[str] | Path to GNPS MN output file. | required | 
| sirius_file | Optional[str] | Path to Sirius output file. | required | 
| isdb_file | Optional[str] | Path to ISDB output file. | required | 
| output | Optional[str] | Output file to save the merged data. | None | 
Returns:
| Type | Description | 
|---|---|
| None | A dataframe with the aligned data (if the output option is used, the dataframe is saved to a file) | 
Source code in met_annot_unifier/cli.py
              | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |  | 
            align_vertically(gnps_file, sirius_file, isdb_file, output=None)
¶
    CLI tool to align and merge data from GNPS, Sirius, and ISDB.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| gnps_file | str | Path to GNPS output file. | required | 
| isdb_file | str | Path to ISDB output file. | required | 
| sirius_file | str | Path to Sirius output file. | required | 
| output | str | Output file to save the merged data. Defaults to None. | None | 
Returns:
| Type | Description | 
|---|---|
| None | A dataframe with the aligned data (if the output option is used, the dataframe is saved to a file) | 
Source code in met_annot_unifier/cli.py
              | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |  | 
            cli()
¶
    Description for your CLI tool.
Source code in met_annot_unifier/cli.py
              | 10 11 12 13 14 |  | 
            prune_table(input_file, list_columns, remove, output=None)
¶
    CLI tool to remove columns from a DataFrame.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| input_file | str | Path to the input file. | required | 
| list_columns | str | list of columns to remove. | required | 
| remove | bool | If True, removes only the specified columns; otherwise, keeps them. | required | 
| output | str | Output file to save the pruned data. Defaults to None. | None | 
Returns:
| Type | Description | 
|---|---|
| None | A dataframe with the pruned data (if the output option is used, the dataframe is saved to a file) | 
Source code in met_annot_unifier/cli.py
              | 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |  | 
            align_data_horizontally(canopus_file=None, gnps_file=None, gnps_mn_file=None, isdb_file=None, sirius_file=None)
¶
    Aligns and merges data from GNPS, Sirius, ISDB and CANOPUS datasets, if provided. This function merges the data horizontally, keeping the data in a wide format. The function standardizes column names, prefixes them to indicate their source, and merges the data based on 'feature_id'.
Args: canopus_file (Optional[str]): File path for the CANOPUS data in TSV format. gnps_file (Optional[str]): File path for the GNPS data in TSV format. isdb_file (Optional[str]): File path for the ISDB data in TSV format. sirius_file (Optional[str]): File path for the Sirius data in TSV format.
Returns: pd.DataFrame: A DataFrame with aligned and merged data from the provided sources.
Source code in met_annot_unifier/aligner/aligner.py
              | 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |  | 
            align_data_vertically(gnps_file=None, isdb_file=None, sirius_file=None)
¶
    Aligns and merges data from GNPS, Sirius, and ISDB datasets optionally. Files can be provided for any subset of these datasets. The function standardizes column names, prefixes them to indicate their source, merges the data based on 'feature_id' and 'IK2D', and then creates consolidated 'Sources' and 'SMILES' columns.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| gnps_file | str | File path for the GNPS data in TSV format. | None | 
| sirius_file | str | File path for the Sirius data in TSV format. | None | 
| isdb_file | str | File path for the ISDB data in TSV format. | None | 
Returns:
| Type | Description | 
|---|---|
| DataFrame | pd.DataFrame: A DataFrame with aligned and merged data from the provided sources. | 
Example
gnps_file = 'path/to/gnps_data.tsv' sirius_file = 'path/to/sirius_data.tsv' aligned_data = align_data_vertically(gnps_file=gnps_file, sirius_file=sirius_file) print(aligned_data.columns) Index(['feature_id', 'IK2D', 'Sources', 'SMILES', ...], dtype='object')
Source code in met_annot_unifier/aligner/aligner.py
              | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |  |