---
title: 运行和验证
description: "1. 使用PuTTY工具，以root用户登录服务器。"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpcindapp/prtg-osc/kunpengbeagle_02_0007.html
sourcePath: /source/zh/kunpenghpcs/hpcindapp/prtg-osc/kunpengbeagle_02_0007.html
indexId: 28f4bb661cd0a6ab25f8f003e0eadfebb565fab2604fa813943ce098645fd79568
---
# 运行和验证

#### 操作步骤

1. 使用PuTTY工具，以root用户登录服务器。
2. 执行以下命令进入“/path/to/BEAGLE”目录。

```
cd
/path/to/BEAGLE
```


3. 执行以下命令创建并编辑脚本文件。

  a. 创建“test.sh”脚本文件。

```
vi test.sh
```


  b. 按“i”进入编辑模式，将以下内容添加到脚本中。

```
#!/bin/sh
echo
echo "*** Creating test files: ref.27Apr20.b81.vcf.gz target.27Apr20.b81.vcf.gz ***"
echo
zcat test.27Apr20.b81.vcf.gz | cut -f1-190 | tr '/' '|' | gzip > ref.27Apr20.b81.vcf.gz
zcat test.27Apr20.b81.vcf.gz | cut -f1-9,191-200 | gzip > target.27Apr20.b81.vcf.gz
echo
echo "*** Running test analysis with \"gt=\" argument ***"
echo
java -jar beagle.27Apr20.b81.jar gt=test.27Apr20.b81.vcf.gz out=out.gt
echo
echo "*** Running test analysis with \"ref=\" and \"gt=\" arguments ***"
echo
java -jar beagle.27Apr20.b81.jar ref=ref.27Apr20.b81.vcf.gz gt=target.27Apr20.b81.vcf.gz out=out.ref
echo
echo "*** Making \"bref3\" file ***"
echo
java -jar bref3.27Apr20.b81.jar ref.27Apr20.b81.vcf.gz > ref.27Apr20.b81.bref3
echo
echo "*** Running test analysis with \"bref3\" file ***"
echo
java -jar beagle.27Apr20.b81.jar ref=ref.27Apr20.b81.bref3 gt=target.27Apr20.b81.vcf.gz out=out.bref3
```


    java -Xmx [ GB ] g -jar beagle.jar [ arguments ] “[GB]”是内存池的上限，以GB为单位，“[arguments]”是一些用空格分隔的参数值。 “[arguments]”有两个参数在使用时必须添加： “gt = [file] ”指定一个vcf文件，其中包含研究样品的基因型数据。 “out = [字符串] ”指定输出文件名前缀。 更多参数的使用请查看官方文档：http://faculty.washington.edu/browning/beagle/beagle_5.1_08Nov19.pdf(http://faculty.washington.edu/browning/beagle/beagle_5.1_08Nov19.pdf)。

  c. 按“Esc”键，输入:wq!，按“Enter”保存并退出编辑。
4. 执行以下命令为脚本添加可执行权限。

```
chmod a+x test.sh
```


5. 执行以下命令运行脚本。

```
./test.sh
```


  运行完成后输出的结果示例如下所示，该结果也会保存至生成的“.log”
  日志文件中。

```
Cumulative Statistics:
Study markers:           1,356
Haplotype phasing time:        1 second
Total time:                    1 second
End time: 10:33 AM CST on 09 May 2020
beagle.27Apr20.b81.jar finished
```
