Created
July 12, 2023 14:33
-
-
Save allaway/9dd3707603f9595c0435853ff46e8d82 to your computer and use it in GitHub Desktop.
make nf-core/rnaseq manifest from Synapse fileview
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(synapser) | |
library(dplyr) | |
synLogin() | |
##query for files for manifest | |
query <- "SELECT id, specimenID, readPair FROM syn51907744 where fileFormat = 'fastq'" | |
key <- "readPair" | |
value <- "id" | |
res <- synTableQuery(query, includeRowIdAndRowVersion = F)$asDataFrame() | |
res_formatted <- res %>% | |
mutate(id = glue::glue("syn://{id}")) %>% | |
tidyr::spread(key = key, value = value) %>% | |
mutate(sample = specimenID, | |
fastq_1 = `1`, | |
fastq_2 = `2`, | |
strandedness = "auto", | |
.keep = 'none') | |
readr::write_csv(res_formatted, "~/downloads/ucf_rnaseq_staging.csv") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment