Converting genbank to GTF?
1
0
Entering edit mode
3.7 years ago
Vanish007 ▴ 50

Hi everyone,

I was given a genbank file (.GB) as a reference and I will be making a custom reference for cell ranger. However I need convert this genbank file to gtf. I've been looking for and trying different methods for a couple of days with no luck.

I saw this answer: How to get GTF file of virus genome but I can't seem to get Bioperl to work. I have installed it through Anaconda but when I try to load it up I receive the following error:

 -bash-4.2$ perl bp_genbank2gff3.pl --dir Viral.GB --GFF_VERSION 2
    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
            LANGUAGE = (unset),
            LC_ALL = (unset),
            LANG = "C.UTF-8"
        are supported and installed on your system.
    perl: warning: Falling back to the standard locale ("C").
    Can't open perl script "bp_genbank2gff3.pl": No such file or directory

I'm running bioperl through linux on an HPC through ssh so I also don't have any administrative permissions.

Thank you in advance.

gtf genbank • 3.9k views
ADD COMMENT
0
Entering edit mode
3.7 years ago

If bioperl is installed correctly then the

bp_genbank2gff.pl 

script can be run without invoking Perl. Use the above command directly. Do

which bp_genbank2gff.pl 

that will print the path to it

FWIW here is another recent, relevant post:

How do I create a gff(3) file from a genebank file?

ADD COMMENT
0
Entering edit mode

Apparently I am having the worst luck with all this.

bp_genbank2gff seems to be located in my anaconda bin path. I can see it there with the "which" command.

However, trying bp_genbank2gff.pl --dir Viral.GB --GFF_Version 2 outputs this error:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "C.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Can't locate Bio/Root/RootI.pm in @INC (you may need to install the Bio::Root::RootI module) (@INC contains: blib/lib /home/bioperl-live /lib/perl5/site_perl/5.22.0/ /home/anaconda3/lib/site_perl/5.26.2/x86_64-linux-thread-multi /home/anaconda3/lib/site_perl/5.26.2 /home/anaconda3/lib/5.26.2/x86_64-linux-thread-multi /home/anaconda3/lib/5.26.2 .) at /home/anaconda3/bin/bp_genbank2gff3.pl line 212.
BEGIN failed--compilation aborted at /home/anaconda3/bin/bp_genbank2gff3.pl line 212.

I even tried following this advice to no avail.

Biopython is also giving me issues even though I installed it, but I may not have installed that correctly since it's showing up through pkgs instead of in anaconda3/bin. When I try and call it I get bio: Command not found

ADD REPLY
1
Entering edit mode

the error messages indicate that your installation is not quite right, make a new environment and try again:

conda create -n test 
conda activate test
conda install -c bioconda perl-bioperl

and try to run your command again, in this new, properly set up environment.

now bio is a separate package (written in Python) you would need to do a

pip install bio

to install it. Try the previous solution first.

ADD REPLY
0
Entering edit mode

So I tried to create the new environment but I got the following:

Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

 environment location: /home/anaconda3/envs/test

#To activate this environment, use     

 #conda activate test

 To deactivate an active environment, use

 $ conda deactivate

-bash-4.2$ conda activate test

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run

$ conda init <SHELL_NAME>

Currently supported shells are:
- bash
- fish
- tcsh
- xonsh
- zsh
- powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.

Trying the init command via conda init test gives:

-bash-4.2$ conda init test

ArgumentError: Invalid shells:
 - test

Currently available shells are:
- bash
- fish
- powershell
- tcsh
- xonsh
- zsh
ADD REPLY
0
Entering edit mode

clearly there is more going on there, conda itself was not installed properly, hence the chain of errors that followed,

the command explains the problem, please read carefully what the error message states

it does not say you should run conda init test it clearly states what the available shells are bash, etc

if you don't know what that means you need a refresher on Unix, without that you won't succeed later on

ADD REPLY
0
Entering edit mode

Thanks Istvan, you're right that running conda init test was an incorrect action - I was letting the frustration of the past few days, and that I'm on a deadline, get to me. Of course I'm still continuing to learn Unix and will keep doing so.

It's difficult to say if conda was installed incorrectly or not since I have been able to use other programs like bwa and samtools without any errors whatsoever. This is the first time I've encountered any errors like this with anaconda.

ADD REPLY
0
Entering edit mode

make sure to always activate the environment before installing or using tools:

 conda activate bioinfo # whatever your environment is called

if you forget to do that tools get installed into the so called "base" environment, leading to various cryptic and confusing errors later on.

This is a usability problem with conda in my opinion, but it is what we have.

When in doubt make a new environment, that is "empty" and "clean" and install your tool into that.

ADD REPLY

Login before adding your answer.

Traffic: 1960 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6