20220624
Gave some consideration/responses to Anamica’s GitHub issue regarding PacBio data for SNP analysis in bacterial cell lines
Added some useful code for writing multiple data frames to CSV in R to avoid having to have individual code for each one:
# Add data frames to list
# Wraps ls() with grep to allow for needed perl regex (the "^(?!list).*" aspect) because
# ls() doesn't support perl regex
# Regex excludes any results beginning with the word "list"
<- mget(grep("^(?!list).*", ls(pattern = "transcript_counts_per_gene_per_sample"), value = TRUE, perl = TRUE))
list_transcript_counts_dfs
# Write data frames to CSVs in ../analyses/dir
# Uses names of data frames as names of output files.
sapply(names(list_transcript_counts_dfs),
function(x) write.csv(list_transcript_counts_dfs[[x]],
file = file.path("../analyses/", paste(x, "csv", sep=".")),
quote = FALSE,
row.names = FALSE)
20220623
DAY OFF
20220622
As part of the CEABIGR project, I parsed and formatted data using awk
to put into R vector. Will print comma-separated, quoted lists of the sample names I wanted (from this file):
# Get Exposed female ample names from second column
awk -F"," '$3 == "Exposed" && $2~"F"{printf "%s%s%s, ", "\"", $2, "\""}' adult-meta.csv
# Get Control females from second column
awk -F"," '$3 == "Control" && $2~"F"{printf "%s%s%s, ", "\"", $2, "\""}' adult-meta.csv
# Get Control female sample names from second column
awk -F"," '$3 == "Control" && $2~"M"{printf "%s%s%s, ", "\"", $2, "\""}' adult-meta.csv
# Get Exposed male sample names from second column
awk -F"," '$3 == "Exposed" && $2~"M"{printf "%s%s%s, ", "\"", $2, "\""}' adult-meta.csv
# Get all Exposed sample names from second column
awk -F"," '$3 == "Exposed" {printf "%s%s%s, ", "\"", $2, "\""}' adult-meta.csv
# Get all Control sample names from second column
awk -F"," '$3 == "Control" {printf "%s%s%s, ", "\"", $2, "\""}' adult-meta.csv