Skip to content

Instantly share code, notes, and snippets.

@allaway
Created July 12, 2023 14:33
Show Gist options
  • Save allaway/9dd3707603f9595c0435853ff46e8d82 to your computer and use it in GitHub Desktop.
Save allaway/9dd3707603f9595c0435853ff46e8d82 to your computer and use it in GitHub Desktop.
make nf-core/rnaseq manifest from Synapse fileview
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