-
Create local repo and create/add/edit required files and dirs
egREADME.md
,Dockerfile
,.gitignore
,.github/workflows/docker-image.yml
-
On GitHub select "New repository" from the "+" menu and set name to match local repo.
Do not add any template files. -
Initialize up local repo and push to GitHub:
(assumes currently in local repo root dir)
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
tibble(x = seq(0, 15, by = 0.5), y = seq(0, 15, by = 0.5)) |> | |
ggplot(aes(x, y)) + | |
geom_point() + | |
scale_y_continuous(breaks = \(x) seq(0, max(x), by = 1)) |
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
# Check length of reads | |
zcat FASTQ_FILE.gz | head -n40 | paste - - - - | cut -f2,2 | awk '{print length}' | |
# Check number and distribution of quality scores | |
zcat FASTQ_FILE.gz | head -n400000 | paste - - - - | cut -f 4 | sed -e $'s/\(.\)/\\1\\\n/g' | sort | uniq -c |
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
# Ignore .DS_Store | |
.DS_Store | |
# Ignore R image files | |
rdata/*RData | |
##################################### | |
# From Github R .gitignore template # | |
##################################### | |
# History files |
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
cat download_links.txt | xargs -P 1 wget --content-disposition --trust-server-names -nv -a wget_downloading.log |
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
# Run from inside analysis_dir | |
echo "Original disk usage:" > temp_BAM_files_deleted.txt | |
du -hs $PWD >> temp_BAM_files_deleted.txt | |
echo "##########" >> temp_BAM_files_deleted.txt | |
echo "Deletion of temporary BAM files:" >> temp_BAM_files_deleted.txt | |
# Delete temp bam files | |
for BAM in $(find $PWD/Sample_*/Alignments/ -name *mapped.no-rgid.bam); do echo $BAM >> temp_BAM_files_deleted.txt; rm $BAM; done | |
for BAM in $(find $PWD/Sample_*/Alignments/ -name *mapped.rgid.bam); do echo $BAM >> temp_BAM_files_deleted.txt; rm $BAM; done |
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
# get standard ggplot colors | |
gg_color_hue <- function(n) { | |
hues = seq(15, 375, length = n + 1) | |
hcl(h = hues, l = 65, c = 100)[1:n] | |
} |
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
obj_size <- function(x) object.size(x) %>% print(units = "auto") |
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
mem_used <- function() lobstr::mem_used() %>% as.numeric() %>% R.utils::hsize() |
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
## Excel export function | |
export_excel <- function(named_list, filename = "") { | |
wb <- openxlsx::createWorkbook() | |
## Loop through the list of split tables as well as their names | |
## and add each one as a sheet to the workbook | |
Map(function(data, name){ | |
openxlsx::addWorksheet(wb, name) | |
openxlsx::writeData(wb, name, data) | |
}, named_list, names(named_list)) | |
## Save workbook to working directory |
NewerOlder