Question: multiple fasta conversion using java
0
gravatar for signaturemdx
17 months ago by
signaturemdx10
signaturemdx10 wrote:

Hi, I ( a biologist and a newcomer to informatics) need help. Really trying hard to learn biopython, but that's another story.

In my folder I have a downloaded java script and a lot of fasta-to-text converted files. Fasta had to be manually converted to text files individually , but no complaint there.

I run java script in a way;

   java -jar ABC.local.jar xaa.txt Out.txt

"java -jar ABC.local.jar" is the command I am supposed to write(copy$paste) in the terminal.

xaa.txt is the input text file converted from fasta.

Out.txt (I name it) is the result file of xaa.txt that was processed through java -jar ABC.local.jar.

It runs beautifully, and I check every 10 minutes and surely get the results I want.

There is a quite number of input file (xaa.txt, xab.txt, xac.txt......), all generating corresponding xaa.txt Out.txt, xab.txt Out.txt, xac.txt Out.txt...result files by the afore-mentioned script.

I assume there would be a way for this process (javascript run) to repeat by itself until all the input files are processed, but it is beyond me.

Or is there? May I ask someone to suggest one?

I know critiques, such as "why haven't you tried at all? etc". I am just not at that stage. Thanks

sequence • 418 views
ADD COMMENTlink modified 17 months ago by Pierre Lindenbaum124k • written 17 months ago by signaturemdx10
1

a lot of fasta-to-text converted files

Fasta format files are plain text. So what is fasta-to-text? Multi-fasta (multiple seq in one file) to one sequence per file fasta?

ADD REPLYlink modified 17 months ago • written 17 months ago by genomax75k
1

On a bit of a tangent: take the plunge into BioPython sooner rather than later would be my advice ;)

Java is not the most widely used language in bioinformatics really.

There's a lot of boilerplate BioPython code out there these days that should require very little tweaking but just enough for you to learn.

ADD REPLYlink written 17 months ago by Joe15k

Thanks for the tip !

ADD REPLYlink written 17 months ago by signaturemdx10

java != java "script"

ADD REPLYlink written 17 months ago by Pierre Lindenbaum124k
4
gravatar for Pierre Lindenbaum
17 months ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum124k wrote:

use a bash loop that will call this java program for each file

something like

ls *.txt | while read F; do  java -jar ABC.local.jar "${F}" "${F}.out" ; done
ADD COMMENTlink written 17 months ago by Pierre Lindenbaum124k
1

It's working nicely !! Thanks

ADD REPLYlink written 17 months ago by signaturemdx10

This shows you how to run the script against all *.txt files in that directory. But be careful. We don't exactly know what you java file is doing. If it uses the same output file names each time it will just overwrite results so you will end up with one set of output files for the last input.

ADD REPLYlink written 17 months ago by genomax75k

All OP's fasta files seem to start with xa (from the description in OP). To be safe, it may be better for OP to restrict the code either with x or xa (some thing like ls x*.txt or ls xa*.txt)

ADD REPLYlink modified 17 months ago • written 17 months ago by cpad011212k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 657 users visited in the last hour