meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
general:computerenvironment:bash [2023/04/11 13:16] – felix | general:computerenvironment:bash [2023/04/11 13:17] (current) – felix | ||
---|---|---|---|
Line 19: | Line 19: | ||
- | '' | + | < |
* You can indicate you want only the rows in which a column meets certain condition. For example, the column 3 requires a value greater than 10. | * You can indicate you want only the rows in which a column meets certain condition. For example, the column 3 requires a value greater than 10. | ||
Line 31: | Line 31: | ||
=== Sort === | === Sort === | ||
- | sort -g -u file.txt | + | < |
* -r to sort in descending order | * -r to sort in descending order | ||
Line 43: | Line 43: | ||
=== Translate === | === Translate === | ||
- | tr ' | + | < |
* This is a trick if you are working on the complementary strand. | * This is a trick if you are working on the complementary strand. | ||
Line 53: | Line 53: | ||
=== sed (slightly more advanced) === | === sed (slightly more advanced) === | ||
- | sed -n -e '/ | + | < |
* This will find AAA, and keep all the lines in a file until it reaches BBB. Pro tip: use this one to extract a sequence in a multi-line fasta. | * This will find AAA, and keep all the lines in a file until it reaches BBB. Pro tip: use this one to extract a sequence in a multi-line fasta. | ||
Line 66: | Line 66: | ||
To compare contents of both files (in this case, the identifiers of the first column of the two files): | To compare contents of both files (in this case, the identifiers of the first column of the two files): | ||
- | '' | + | < |
* Within each "< | * Within each "< | ||
Line 72: | Line 72: | ||
* I use the second part of the command (the sed) to adjust the output to have the correct number of columns | * I use the second part of the command (the sed) to adjust the output to have the correct number of columns | ||
- | '' | + | < |
* Output: | * Output: | ||
Line 86: | Line 86: | ||
Join two tables based on a column in common. | Join two tables based on a column in common. | ||
- | '' | + | < |
* Input within the "< | * Input within the "< | ||
Line 93: | Line 93: | ||
* The standard output will display only lines with columns in common. We can add option -a1 or -a2 to also include the entries of one of the tables, with no joined values from other. Do not use both. | * The standard output will display only lines with columns in common. We can add option -a1 or -a2 to also include the entries of one of the tables, with no joined values from other. Do not use both. | ||
- | '' | + | < |