How to Use JBQR
JBQR is an R wrapper for JBQ, designed to simplify common functions and make them easier to use.
Create an Instance of the JBQ class
The constructor of the JBQ class accepts one parameter: the path to the data package directory or the zip file. This path can be either an absolute path or a relative path where the R script is executed.
# use zip file
# Replace 'path_to_zip_file' with the actual path where JAXDP00006X.zip is saved
jbq_obj <- JBQ$new("path_to_zip_file/JAXDP00006X.zip")
# use unzipped directory
# the full path for the data package folder, eg, `/tmp/JAXDP00006X`
jbq_obj <- JBQ$new("full_path_to_data_package_directory")
Show Study
Show all studies in a data package
full_data_package_path <- "C:\\Users\\liangh\\Desktop\\BioConnect_Data\\JAXDP00006X"
jbq_obj <- JBQ$new(full_data_package_path)
jbq_obj$show_studies()
[1] ""
[2] "Data Package Root: \"C:\\Users\\liangh\\Desktop\\BioConnect_Data\\JAXDP00006X\""
[3] "Read Sucess: C:\\Users\\liangh\\Desktop\\BioConnect_Data\\JAXDP00006X"
[4] " total number of triples: 3215"
[5] ""
[6] " Study"
[7] "+-- Name: JAXST00001R"
[8] "+-- Title: Mass Spectrometry analysis of \"Three Bears\" mice on control or high "
[9] "| fat high sugar diet. Proteomics and Metabolomics."
[10] "+-- Description: Starting at 6 weeks of age, half the animals per strain were "
[11] "| fed control diet, and the other half were fed high fat, high sugar diet "
[12] "| (HFHS). The same animals were used in metabolic phenotyping and RNA "
[13] "| sequencing."
[14] "`-- Comments: "
[15] " `-- Species: mouse"
Get Assay Samples
Get all samples of the assays in a data package into a dataframe
assay_samples = jbq_obj$get_assay_samples()
assay_samples
> assay_samples
sample_name source_name diet sex strain treatment genotype
1 ORSAM17290-1 JMUSf37118ffca35cf6d2939ae5f8c941d14 10% fat + fiber female C57BL/6J NA NA
2 ORSAM17291-1 JMUSe85c53436f70930c804c17124f048e32 10% fat + fiber female C57BL/6J NA NA
3 ORSAM17292-1 JMUSbbaa0055849bba97849f0067c458e889 10% fat + fiber male C57BL/6J NA NA
4 ORSAM17293-1 JMUSc2113932b206a2c9749d1ad9d20655dd 10% fat + fiber male C57BL/6J NA NA
5 ORSAM17294-1 JMUS613846554fc300089758a7a2fe624f41 10% fat + fiber female NZO/HlLtJ NA NA
......
options("width"=200)
to set the terminal width
Show Files
Show all the files in a data package
jbq_obj$show_files()
> jbq_obj$show_files()
[5] " Files "
[6] "+-----------------------------------------------------------------------------+"
[7] "| File Name || Investi\x85 | Study |Assay|"
[8] "|----------------------------------------------++----------+---------+--------|"
[9] "| 202111_CUBE_Islet_Discovery_Proteomics_ \x85 || JAXIN00\x85 | JAXST0\x85 | JAXAS\x85 |"
[10] "| 2021_CUBE_Adipose_C18negative_All-Data.xlsx || JAXIN00\x85 | JAXST0\x85 | JAXAS\x85 |"
[11] "| 2021_CUBE_Adipose_C18negative_metadata.csv || JAXIN00\x85 | JAXST0\x85 | JAXAS\x85 |"
[12] "| 2021_CUBE_Adipose_C18positive_All-Data.xlsx || JAXIN00\x85 | JAXST0\x85 | JAXAS\x85 |"
[13] "| 2021_CUBE_Adipose_C18positive_metadata.csv || JAXIN00\x85 | JAXST0\x85 | JAXAS\x85 |"
......
Download Files
Download files in a data package The file_names parameter in your command can accept either a single file name or a list of file names separated by commas.
You can use the wildcard * in the file_names parameter to match multiple files based on patterns.
- at the beginning: Matches files ending with a specific suffix.
- at the end: Matches files starting with a specific prefix.
- at both ends: Matches files containing a specific substring.
The following will get download all the files whose file name contains "raw"
jbq_obj$get_files("*liver*")
[8] " 10 Files, 124.0 MB to be downloaded"
[9] "+-- 2021_CUBE_Liver_C18negative_All-Data.xlsx 20.7 MB"
[10] "+-- 2021_CUBE_Liver_C18negative_metadata.csv 3.9 KB"
[11] "+-- 2021_CUBE_Liver_C18positive_All-Data.xlsx 28.9 MB"
[12] "+-- 2021_CUBE_Liver_C18positive_metadata.csv 3.9 KB"
[13] "+-- 2021_CUBE_Liver_Discovery_Proteomics_Data.xlsx 58.8 MB"
[14] "+-- 2021_CUBE_Liver_HILICnegative_All-Data.xlsx 5.5 MB"
[15] "+-- 2021_CUBE_Liver_HILICnegative_metadata.csv 3.9 KB"
[16] "+-- 2021_CUBE_Liver_HILICpositive_All-Data.xlsx 9.9 MB"
[17] "+-- 2021_CUBE_Liver_HILICpositive_metadata.csv 3.9 KB"
[18] "`-- liver_metadata.csv 3.9 KB"
[19] " 1 saved: JAXDP00006X\\2021_CUBE_Liver_C18negative_All-Data.xlsx"
[20] " 2 saved: JAXDP00006X\\2021_CUBE_Liver_C18negative_metadata.csv"
[21] " 3 saved: JAXDP00006X\\2021_CUBE_Liver_C18positive_All-Data.xlsx"
[22] " 4 saved: JAXDP00006X\\2021_CUBE_Liver_C18positive_metadata.csv"
[23] " 5 saved: JAXDP00006X\\2021_CUBE_Liver_Discovery_Proteomics_Data.xlsx"
[24] " 6 saved: JAXDP00006X\\2021_CUBE_Liver_HILICnegative_All-Data.xlsx"
[25] " 7 saved: JAXDP00006X\\2021_CUBE_Liver_HILICnegative_metadata.csv"
[26] " 8 saved: JAXDP00006X\\2021_CUBE_Liver_HILICpositive_All-Data.xlsx"
[27] " 9 saved: JAXDP00006X\\2021_CUBE_Liver_HILICpositive_metadata.csv"
[28] " 10 saved: JAXDP00006X\\liver_metadata.csv"