Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have a problem with executing variant call #188

Open
otienolwanga opened this issue Sep 14, 2019 · 7 comments
Open

I have a problem with executing variant call #188

otienolwanga opened this issue Sep 14, 2019 · 7 comments

Comments

@otienolwanga
Copy link

bcftools mpileup -0 b -o $raw_bcf -f $genome $sorted_bam

code breaks each time I run the above command. It says Unrecognized command. What could I be doing wrong?

Also, each time I run a variant call for multiple samples (38 samples), on the first sample is processed up to where the pipe breaks.

Below is my script for the variant calling:

set -e

cd  /data10/working_groups/balint_group/charlesotieno/project1/results

genome=/data10/genomes/hg38/index/hg38.fa

mkdir -p sam bam bcf vcf


for fq in /data10/working_groups/balint_group/charlesotieno/project1/data/untrimmed_fastq/*.fastq
do
echo “Working with file $fq”

base=$(basename $fq)
echo “base name is $base”

fq=/data10/working_groups/balint_group/charlesotieno/project1/data/untrimmed_fastq/${base}
sam=/data10/working_groups/balint_group/charlesotieno/project1/results/sam/${base}.aligned.sam
bam=/data10/working_groups/balint_group/charlesotieno/project1/results/bam/${base}.aligned.bam
sorted_bam=/data10/working_groups/balint_group/charlesotieno/project1/results/bam/${base}.aligned.sorte$
raw_bcf=/data10/working_groups/balint_group/charlesotieno/project1/results/bcf//${base}_raw.bcf
variants=/data10/working_groups/balint_group/charlesotieno/project1/results/bcf/${base}_variants.vcf
final_variants=/data10/working_groups/balint_group/charlesotieno/project1/results/vcf/${base}_final_var$

bwa mem $genome $fq > $sam
samtools view -S -b $sam > $bam
samtools sort -o $sorted_bam $bam
samtools index $sorted_bam
bcftools mpileup -0 b -o $raw_bcf -f $genome $sorted_bam
bcftools call - - ploidy 1 -m -v -o $variants $raw_bcf
vcfutils.pl varFilter $variants > final_variants

done

PLEASE HELP!!!

@otienolwanga
Copy link
Author

bcftools mpileup -0 b -o $raw_bcf -f $genome $sorted_bam This command is not working.It gives the output Unrecognized command. Are there alternatives to this command?

@fpsom
Copy link
Contributor

fpsom commented Sep 14, 2019

Hi @otienolwanga ! I'm really sorry to hear that. Could you provide me with some additional information so that I can figure out what the problem might be?

  1. Are you using an Carpentries AMI instance or have you setup the tools in your own machine / environment?
  2. If the second (i.e. your own env), which version of bcftools have you installed? As you can see in the setup page, all commands have been tested using the respective versions (BCFtools version 1.8 in this case).
  3. Is there any additional info to the Unrecognized command message? For example, if you run the command bcftools --version what is the produced output?

@otienolwanga
Copy link
Author

Hello @fpsom! I am using the University Server not the Carpentries AMI instance. The bcftools is installed but I am not quite sure which version it is; I can't figure out the version from the server as bcftools --version won't work. Apparently, all the tools in carpentries AMI instance are installed in our server as well.
As to the third question, the loop runs until bcftools mpileup -0 b -o $raw_bcf -f $genome $sorted_bam then Unrecognized command and that's the end of it; no additional information. It just stops. The rest of the samples don't even get processed.

@fpsom
Copy link
Contributor

fpsom commented Sep 14, 2019

Hi @otienolwanga, thanks for the details.

To me, it seems that bcftools is not installed (or at least, incorrectly installed) - hence the Unrecognized command error, and why the loop fails at that particular point. My suggestion would be to re-install the software (if you have the admin rights), or ask the IT team to assist in this. The easiest solution (that I usually go for) is to go through conda - this option also let's you install the specific version. Alternatively, you can look through the installation instructions of the main bcftools website.

@otienolwanga
Copy link
Author

Thank you @fpsom for your help. I will contact the server admin to reinstall it since I do not have the rights. I will update you on the progress.

Kind regards

@jrkirk61
Copy link

jrkirk61 commented Feb 7, 2020

I'm jumping in on this late, but could the problem be the typo in the first option listed: -0 b? This should actually be the capital letter O, not zero. So it should read -O b instead.

@larahurban
Copy link

Hi All,

I just tested the respective commands, and when typing

bcftools mpileup -0 b -o $raw_bcf -f $genome $sorted_bam

I get the same error.

When changing this to

bcftools mpileup -O b -o $raw_bcf -f $genome $sorted_bam

it works for me.

Could you confirm that this was the problem @otienolwanga?

Thank you,
Lara

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants