0

各染色体の SNP のグループに基づいて、より小さな VCF ファイルを作成しようとしていました。この構文を使用して、最初の 3 つを手動で作成しました

tabix ALL.chr3.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz -R chr3.tabix.txt > chr3SNPS.vcf

次に、染色体 4 ~ 17 の bash ループで同じ関数を実行しようとしました。

私はいくつかの異なる方法を試しましたが、そのうちの 1 つだけが機能し、希望どおりの方法ではありませんでした。

最初に試した

for i in {4..17}; do tabix ALL.chr$i.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz -R chr$i.tabix.txt > chr$iSNPS.vcf;done

しかし、それを実行すると、chr.vcfという名前のファイルが1つだけ出力されます

私はそれから試しました

for i in {4..17}; do tabix ALL.chr$i.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz -R chr$i.tabix.txt > chr$i_SNPS.vcf;done

しかし、まったく同じ結果が得られました。

それから私はこれを試してみて、さらに遠くに行くことに気づきました

for i in {4..17}; do X="ALL.chr$i.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz";Y="chr$i.tabix.txt";Z= "chr$iSNPS.vcf";tabix $X -R $Y > $Z;done
-bash: ALL.chr4.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz: command not found
-bash: chr.vcf: command not found
-bash: ${Z}: ambiguous redirect
-bash: ALL.chr5.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz: command not found
-bash: chr.vcf: command not found
-bash: ${Z}: ambiguous redirect
…
…
…
-bash: ALL.chr17.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz: command not found
-bash: chr.vcf: command not found
-bash: ${Z}: ambiguous redirect

私はついにこれを試しました:

for i in {4..17}; do tabix "ALL.chr$i.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz" -R "chr$i.tabix.txt" > "chr$i.snps.vcf";done

それは機能しましたが、必要な chr4SNPS.vcf の代わりに chr4.snps.vcf の形式のファイルを生成しました

入出力されるファイルが不明な場合

4

0 に答える 0