loader
get_backend()
Returns the backend used for data handling.
Source code in hdxms_datasets/loader.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
load_peptides(peptides, base_dir=Path.cwd(), convert=True, aggregate=None, sort_rows=True, sort_columns=True, drop_null=True)
Load peptides from the data file and return a Narwhals DataFrame.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
peptides
|
Peptides
|
Peptides object containing metadata and file path. |
required |
base_dir
|
Path
|
Base directory to resolve relative file paths. Defaults to the current working directory. |
cwd()
|
convert
|
bool
|
Whether to convert the data to a standard format. |
True
|
aggregate
|
bool | None
|
Whether to aggregate the data. If None, will aggregate if the data is not already aggregated. |
None
|
sort_rows
|
bool
|
Whether to sort the rows. |
True
|
sort_columns
|
bool
|
Whether to sort the columns in a standard order. |
True
|
drop_null
|
bool
|
Whether to drop columns that are entirely null. |
True
|
Returns:
Type | Description |
---|---|
DataFrame
|
A Narwhals DataFrame containing the loaded peptide data. |
Source code in hdxms_datasets/loader.py
85 86 87 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 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 |
|
read_csv(source)
Read a CSV file and return a Narwhals DataFrame.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source
|
Path | str | IO | bytes
|
Source object representing the CSV data. |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
A Narwhals DataFrame containing the CSV data. |
Source code in hdxms_datasets/loader.py
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 |
|