Last active
September 30, 2018 04:47
-
-
Save popucui/6f3295d5f854f8b8b54eb8d822f54015 to your computer and use it in GitHub Desktop.
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
# print 2 line into one | |
awk 'NR%2{printf "%s ",$0;next;}1' yourFile | |
# copy files using rsync | |
rsync -avz -h --progress --files-from=./fastq_list user@host:/ . | |
# change password from script | |
# this is used not often, yet can be very useful when you need to change passwd from VPS provider's dasgboard | |
`echo "newpasswd" | passwd root --stdin` | |
# transform head line to a vector | |
head -1 /path/to/file_with_multiple_columns.tsv | awk 'ORS=", " { for(i=1; i<=NF; i++) {print "\""$i"\""} }' | |
# add space for string as "2/13", for MS Excel will automatically recognize "2/13" as date format "Feb. 13th" | |
sed -i -re 's#([[:digit:]]+/[[:digit:]]+)# \1#' variant_summary/vm_gt002.xls | |
# map Ensembl transcript ID to Refseq ID | |
mysql -u anonymous -h ensembldb.ensembl.org homo_sapiens_core_75_37 -B -e | |
"SELECT transcript.stable_id, xref.display_label FROM transcript, object_xref, xref,external_db | |
WHERE transcript.transcript_id = object_xref.ensembl_id AND object_xref.ensembl_object_type = 'Transcript' | |
AND object_xref.xref_id = xref.xref_id AND xref.external_db_id = external_db.external_db_id | |
AND external_db.db_name = 'RefSeq_mRNA';" > ensemble_refseq.txt | |
# match single quote in sed | |
sed -i 's#5'\''URS#5_URS#' downloads/variant_summary.txt | |
# To escape single quote or double quote in PHP when talking to MySQL, check http://php.net/mysqli_real_escape_string | |
$city = "'s Hertogenbosch"; | |
$city = mysqli_real_escape_string($link, $city); |
Author
popucui
commented
Aug 22, 2018
•
# convert SAM/BAM to fasta
samtools view -bS L15M_CCDC6.sam | samtools bam2fq - | seqtk seq -A - > tmp/L15_CCDC6_reads.fa
# split a large file by size, 1G here
split -b 1024m "file.tar.gz" "file.tar.gz.part-"
# test disk IO speed
dd if=/dev/zero of=/tmp/test1.img bs=1G count=10 oflag=dsync
# vep use online database
/data/home/jiecui/software/anaconda2/envs/py36/bin/vep --no_progress --cache --force --stats_text --numbers --hgvs --fasta /home/athurvagore/.vep/homo_sapiens/84_GRCh37/Homo_sapiens.GRCh37.75.dna.primary_assembly.fa --af --af_1kg --pubmed --check_existing --protein --symbol --xref_refseq --vcf --allow_non_variant --dir /data/home/jiecui/database/vep/v90_grch37 --assembly GRCh37 --fork 4 -i <input.txt> --port 3337 -o <output_vep.vcf>
# input.txt could be: 17:g.41246595T>ACA
# check my IP address
curl https://api.myip.com
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment