Skip to content

ricardoi/cheatsheets

Repository files navigation

Cheat sheet documentation

@author: Ricardo I. Alcala

Personal notes, and code collected through the years finding solutions.

Personal pages:

**Basic Usage and Tutoriasl **
Blast commands
Git commands
Git nice tutorialBig Files Program language examples
R examples
• Julia examples
SLURM script
Bash manipulation
Bash commands to manipulate fasta files
• Bash commands and files manipulation
other bash tricks
Regular Expressions\

Notes

If you install R and Rstudio with brew, it won't install igraph and install.packages("RcppArmadillo") due to a clang & c++11 problem. However, you can install XQuartz and fortran from the R website. Make sure xcode-select --install is installed.

bash

If you need an introduction to bash command lines go to this document

Basic commands:
mkdir - make a new direcotry
ls - list the directories
ls -l - list the directories as a list
ls -lt - list the directories as a list by time
cp - copy a file
mv - move a file or rename a file
If you want more, check the document

find empty folders find . -depth -type d -empty

loops in bash

There are several ways to do for loops in bash, so far this is my favorite syntax:

while IFS= read -r line
do
  Rscript --vanilla ~/folder/file.R $line
done < file_with_lines.txt

I like this bash script to go trhough multiple files: useful_script.sh

list=$(ls *.fasta | cut -d_ -f1)
while IFS= read -r line
do
  Rscript --vanilla ~/folder/file.R $line
done <<< "list"

Then execute it with sh useful_script.sh, probably you nedd to chmod +x useful_script.sh first.

This is a nice command to look at your directory structure

$ tree -La 5 -F

This is a nice shortcut to search for a specific "pattern" in a folder

grep -Rin 'core' | less
tricks in bash for fasta manipulation

Fasta files some times are tricky to manipulate, and there are many softwares for fasta manipulations. I prefer using bash commamnds to find fast results, check this repo with commands to manipulate fasta files.

Regular Expressions

Cheatsheet for [RegEx](https://github.com/ricardoi/cheatsheets/blob/master/ReGex101.md

https://observablehq.com/@ricardoi

About

temp webpages of personal cheatsheet

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages