根据文件大小或自定义次数进行复制
摘要:#!/bin/bash cp $1 1mb$1 size=$(stat $1 |grep Size|awk '{print $2}') while [ $size -le $2] do cat $1 >>1mb$1 size=$(stat 1mb$1|grep Size|awk '{print $2
阅读全文
gwas流程
摘要:1.首先创建ID列表和表型文件用gwas5.sh进行FarmCPU和MLM进行关联分析(mvp_p_k.r),同时计算了PCA。 2.用lddecay.sh计算vcf的ld,储存在lddecay文件夹 3.用annovar对vcf进行注释,得到hmp.txt文件 4.通过比较QQ图发现FarmCPU
阅读全文
从significant snp 的LD 范围内的SNP,进行finemap定位分析
摘要:#!/bin/bash #set -Eeuo pipefail if [ $# -lt 2 ] then echo "par1 is vcf,par2 is pvalue,sample_size=297" exit fi #vcftools --vcf $1 --freq --out ${1}maf
阅读全文
利用peak_snp,找其LD块,并找到其中的基因,然后将LD中的SNP信息变成finemap软件的输入格式
摘要:#!/bin/bash #LD PLOT #author lee echo"par1 is vcf,par2 is top_chr" Genome=/public/home/caisl/lee/genome/rice/msu.gff3 while read chr pos do pos_up=$((
阅读全文
shell 脚本模板
摘要:#!/usr/bin/env bash #this srcipt is to do wheat_bsa #author lee #this is fail test, because bash didn't care about the failure of command #this can pr
阅读全文
交互或批量计算区间内基因数目(while read)
摘要:###1.交互状态 #!/bin/bash #count genes in region,need three para #author lee if [ $# -ne 3 ] then echo "Usage chr start end" else num=$(awk -v chr=$1 -v s
阅读全文
统计文件某列各项或某项出现次数(VCF文件中每个染色体信息)
摘要:#!/bin/bash grep -v ^# $i|awk '{sum[$1+=1]END{for(i in sum)print i"\t" sum[i]}' >chr_info #按大小排序 sort -n chr_info #某列求和 awk '{sum +=$2;END {print sum}
阅读全文
shell 下实现VLOOKUP
摘要:#!/bin/bash #vlookup #author lee #date 2021.8.26 if [ $# -ne 2 ] then echo "File number supplied is not right" echo "Input File1 that have your info"
阅读全文