openpgp4fpr:945A28513CB2BE6D67602C0F37BCE34F94A3D0BE
This file contains 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
HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008 | |
Compiled by Eric Pement - eric [at] pement.org version 0.27 | |
Latest version of this file (in English) is usually at: | |
http://www.pement.org/awk/awk1line.txt | |
This file will also be available in other languages: | |
Chinese - http://ximix.org/translation/awk1line_zh-CN.txt | |
USAGE: |
This file contains 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
#!/bin/bash | |
# for all files in folder, remove newlines | |
for FILE in `ls` | |
do | |
tr -d '\n' < $FILE > ${FILE}.tmp | |
mv ${FILE}.tmp $FILE | |
done |
This file contains 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
#!/bin/sh | |
mkdir mp3 | |
for I in *.flac; do | |
flac -d --stdout "$I" | lame -V0 --vbr-new - mp3/"$I" | |
done | |
for J in *.flac; do | |
id3cp -2 "$J" mp3/"$J" | |
done |
This file contains 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
function cellArray = cellFromTextFile(fileName) | |
% Loads cell array of strings, 1xN character arrays, from the given text | |
% file. | |
if exist(fileName, 'file') == 0 | |
error('unable to read file, %s, does not exist', fileName); | |
end | |
try | |
cellArray = textread(fileName, '%s'); | |
catch ME | |
error('unable to read file, %s: %s', ME.message); |
This file contains 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
function error_jitter(xvals, yvals, errvals) | |
%%ERROR_JITTER(xvals, yvals) | |
% | |
% xvals -> array of x positions | |
% yvals -> cell array of multiple y positions for each x position | |
% errvals -> cell array of multiple std/sem for each x position | |
% TODO: allow yvals/errvals to be ragged array | |
% | |
% author: William Rowell ([email protected]) |
This file contains 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
#!/usr/bin/env python3 | |
"""Coverage mean and standard deviation of autosomes | |
Estimate the mean and standard deviation from a mosdepth coverage BED for | |
positions with coverage in the range (0, 2 * non-zero mode). This estimate | |
behaves well for PacBio HiFi WGS of human germline aligned to either hs37d5 and | |
GRCh38, and may be useful for other situations as well. | |
$ bash mosdepth --threads 3 --no-per-base --by 500 -m "${BAM%.*}.median" "${BAM}" | |
$ tabix ${BAM%.*}.median.regions.bed.gz {1..22} | python depth_mean_stddev.py |
This file contains 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
#!/usr/bin/env bash | |
# from https://leancrew.com/all-this/2022/01/reducing-the-size-of-large-pdfs/ | |
# Reduces the size of PDF plots created by Matplotlib. | |
# Assumes that the files to be reduced are named mpl[Something].pdf | |
# and that it's called via | |
# | |
# reduceMPL mpl*.pdf | |
# |