Skip to content

A rust library to read Illumina Idat files. A port of illuminaio.

License

Notifications You must be signed in to change notification settings

a-xavier/illumina_array_reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

illumina_array_reader

A rust library to read Illumina Idat files. A port of illuminaio.

How to implement in your project

Add this line to you Cargo.toml within the [dependencies] section:
illumina_array_reader = {git = "https://github.com/a-xavier/illumina_array_reader.git"}

How to use

illumina_array_reader implements two structs MicroArray and Idat. In practice, one would only need to use MicroArray since it's a collection of a red and a green Idat.

Each Idat struct contains descriptions and most importantly, a data field containing a polars DataFrame with the data contained in the idat (ProbeID, Mean fluorescence, Fluorescence Standard Deviation and Number of beads).

To load an array, just provide a Basename. A Basename is the path to both idat files, without the _Grn.idat or _Grn.idat.gz.

For example:

use illumina_array_reader::array::MicroArray;
fn main() {
    let array = MicroArray::from_base("/path/to/files/203952880120_R01C01");

    dbg!(array);
}

Will print:

MicroArray::from_base(all_idats[0]) = MicroArray {
    basename: "/path/to/files/203952880120_R01C01",
    green_idat: Idat {
        pathname: "/path/to/files/203952880120_R01C01_Grn.idat",
        is_red: false,
        is_green: true,
        processed: true,
        is_valid_idat: true,
        total_number_of_beads: 1051815,
        barcode: "203952880120",
        position: "R01C01",
        data: shape: (1_051_815, 4)
        ┌──────────┬───────┬──────┬─────────┐
        │ IDMeanSDN_beads │
        │ ---      ┆ ---   ┆ ---  ┆ ---     │
        │ u32u16u16u8      │
        ╞══════════╪═══════╪══════╪═════════╡
        │ 160010110409127514      │
        │ 1600111575430210      │
        │ 1600115253944219      │
        │ 1600123554070320      │
        │ …        ┆ …     ┆ …    ┆ …       │
        │ 9981097098386       │
        │ 99810978795341217      │
        │ 9981099054747359       │
        │ 99810992418150825      │
        └──────────┴───────┴──────┴─────────┘,
        chip_type: "BeadChip 8x5",
    },
    red_idat: Idat {
        pathname: "/path/to/files/203952880120_R01C01_Red.idat",
        is_red: true,
        is_green: false,
        processed: true,
        is_valid_idat: true,
        total_number_of_beads: 1051815,
        barcode: "203952880120",
        position: "R01C01",
        data: shape: (1_051_815, 4)
        ┌──────────┬───────┬──────┬─────────┐
        │ IDMeanSDN_beads │
        │ ---      ┆ ---   ┆ ---  ┆ ---     │
        │ u32u16u16u8      │
        ╞══════════╪═══════╪══════╪═════════╡
        │ 1600101464892314      │
        │ 16001114382111010      │
        │ 160011527623277319      │
        │ 1600123332265220      │
        │ …        ┆ …     ┆ …    ┆ …       │
        │ 9981097026278066       │
        │ 99810978529694717      │
        │ 998109901520818839       │
        │ 9981099272845825      │
        └──────────┴───────┴──────┴─────────┘,
        chip_type: "BeadChip 8x5",
    },
}

To Do

  • Clean up the code and remove all .unwrap() calls -> Properly handle errors
  • Create Errors
  • Eliminate need for SD and N_Beads to reduce space
  • Set up tests

About

A rust library to read Illumina Idat files. A port of illuminaio.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages