Sponsored Content
Top Forums UNIX for Dummies Questions & Answers File names based off of wildcards Post 302162751 by tcquad on Wednesday 30th of January 2008 01:27:13 AM
Old 01-30-2008
File names based off of wildcards

Hello all-

First post, so just to forewarn you: I know enough about Perl and the Terminal to get myself into trouble, not quite enough to always get out.

I'd like to know if it is possible to, from the command prompt, use a wild-card to declare the names of files for input and then use the value of the wild card in the same line to declare the name for the output. I'm using the BLAST package to search through genes, so what I'd like to have is:

% blastall -p blastn -i *.dna -o (some-variable).output

The -p calls the blastn part of the package, the -i declares the input to be all the genes in the directory and the -o declares the output. I'd like it if a geneA.dna file, for instance, produced an output file called geneA.output.

It strikes me as one of those glaringly obvious things I've overlooked at some point, but I have no idea what could be put in the (some-variable) portion of the command. Gory details: using the public BLAST package (so I can't edit anything within there easily to... at all), executing on a Mac OS X Terminal session. If you need any other details, please let me know.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Separate based on file names

Hello experts, This might prove to be a stupid question to some of you, but I have tried to tackle it in different ways. Being new to shell scripting, I am requesting your help in coming up with an elegant solution. I am using Korn shell. We have a directory with file names with the pattern:... (2 Replies)
Discussion started by: prashk15
2 Replies

2. Shell Programming and Scripting

Searching for file names in a directory while ignoring certain file names

Sun Solaris Unix Question Haven't been able to find any solution for this situation. Let's just say the file names listed below exist in a directory. I want the find command to find all files in this directory but at the same time I want to eliminate certain file names or files with certain... (2 Replies)
Discussion started by: 2reperry
2 Replies

3. Shell Programming and Scripting

Archive different folders based on their names

This is my first post so ... be gentle:) Hello I have several folders that are backed up daily in following format: /back_YY.MM.DD/backup1/* ........................./backup2/* I looking a script to archive and rename all backup folders bazed on root folder... (8 Replies)
Discussion started by: vilibit
8 Replies

4. Shell Programming and Scripting

Sorting file based on names

Hi I have some files in directory and the names of files are like jnhld_15233_2010-11-23 jnhld_15233_2007-10-01 jnhld_15233_2001-05-04 jnhld_15233_2011-11-11 jnhld_15233_2005-06-07 jnhld_15233_2000-04-01 ..etc How can i sort these files based on the date in the file name so that ... (4 Replies)
Discussion started by: morbid_angel
4 Replies

5. Shell Programming and Scripting

Exclude certain file names while selectingData files coming in different names in a file name called

Data files coming in different names in a file name called process.txt. 1. shipments_yyyymmdd.gz 2 Order_yyyymmdd.gz 3. Invoice_yyyymmdd.gz 4. globalorder_yyyymmdd.gz The process needs to discard all the below files and only process two of the 4 file names available ... (1 Reply)
Discussion started by: dsravanam
1 Replies

6. Shell Programming and Scripting

Sort html based on .jar, .war file names and still keep text within three groups.

Output from zipdiff GNU EAR comparison tool produces output in html divided into three sections "Added, Removed, Changed". I want the output to be sorted by jar or war file. <html> <body> <table> <tr> <td class="diffs" colspan="2">Added </td> </tr> <tr><td> <ul>... (5 Replies)
Discussion started by: kchinnam
5 Replies

7. UNIX for Dummies Questions & Answers

Allocating names to folders based on a file

Hi everyone, I have a problem and I would be gratful if you can help. I have set of folders with files in them. e.g. data1, data2, data3 and I have a json file with info ... looking like this I want to rename my files to replace the data with their gender to some processing and back to... (8 Replies)
Discussion started by: A-V
8 Replies

8. Shell Programming and Scripting

Concatenate files based on names

Dear all, I have a list of files and I woulk like to concatenate some of them based on their name. Basically my files are names like that: file1_abcd_other_useless_letters_1_C1.txt file1_abcd_other_useless_letters_1_C2.txt file1_xywz_other_useless_letters_1_C1.txt... (4 Replies)
Discussion started by: giuliangiuseppe
4 Replies

9. UNIX for Beginners Questions & Answers

Consternation of multiple file names based on naming pattern

Hi, I have the following reports that get generated every 1 hour and this is my requirement: 1. 5 reports get generated every hour with the names "Report.Dddmmyy.Thhmiss.CTLR" "Report.Dddmmyy.Thhmiss.ACCD" "Report.Dddmmyy.Thhmiss.BCCD" "Report.Dddmmyy.Thhmiss.CCCD"... (1 Reply)
Discussion started by: Jesshelle David
1 Replies

10. UNIX for Beginners Questions & Answers

Sort a text file based on names in square brackets

Hi all, I have a text file similar to this: Text More text Etc Stuff That Is Needed Etc Etc This contains over 70 entries and each entry has several lines of text below the name in square brackets. (5 Replies)
Discussion started by: Scally
5 Replies
Bio::Tools::Run::StandAloneNCBIBlast(3pm)		User Contributed Perl Documentation		 Bio::Tools::Run::StandAloneNCBIBlast(3pm)

NAME
Bio::Tools::Run::StandAloneNCBIBlast - Object for the local execution of the NCBI BLAST program suite (blastall, blastpgp, bl2seq). With experimental support for NCBI rpsblast. SYNOPSIS
# Do not use directly; see Bio::Tools::Run::StandAloneBlast DESCRIPTION
See Bio::Tools::Run::StandAloneBlast FEEDBACK
Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists Support Please direct usage questions or support issues to the mailing list: bioperl-l@bioperl.org rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. Reporting Bugs Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ AUTHOR - Peter Schattner Email schattner at alum.mit.edu MAINTAINER - Torsten Seemann Email torsten at infotech.monash.edu.au CONTRIBUTORS
Sendu Bala bix@sendu.me.uk (reimplementation) APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ new Title : new Usage : my $obj = Bio::Tools::Run::StandAloneBlast->new(); Function: Builds a newBio::Tools::Run::StandAloneBlast object Returns : Bio::Tools::Run::StandAloneBlast Args : -quiet => boolean # make program execution quiet -_READMETHOD => 'BLAST' (default, synonym 'SearchIO') || 'blast_pull' # the parsing method, case insensitive Essentially all BLAST parameters can be set via StandAloneBlast.pm. Some of the most commonly used parameters are listed below. All parameters have defaults and are optional except for -p in those programs that have it. For a complete listing of settable parameters, run the relevant executable BLAST program with the option "-" as in blastall - Note that the input parameters (-i, -j, -input) should not be set directly by you: this module sets them when you call one of the executable methods. Blastall -p Program Name [String] Input should be one of "blastp", "blastn", "blastx", "tblastn", or "tblastx". -d Database [String] default = nr The database specified must first be formatted with formatdb. Multiple database names (bracketed by quotations) will be accepted. An example would be -d "nr est" -e Expectation value (E) [Real] default = 10.0 -o BLAST report Output File [File Out] Optional, default = ./blastreport.out ; set by StandAloneBlast.pm -S Query strands to search against database (for blast[nx], and tblastx). 3 is both, 1 is top, 2 is bottom [Integer] default = 3 Blastpgp (including Psiblast) -j is the maximum number of rounds (default 1; i.e., regular BLAST) -h is the e-value threshold for including sequences in the score matrix model (default 0.001) -c is the "constant" used in the pseudocount formula specified in the paper (default 10) -B Multiple alignment file for PSI-BLAST "jump start mode" Optional -Q Output File for PSI-BLAST Matrix in ASCII [File Out] Optional rpsblast -d Database [String] default = (none - you must specify a database) The database specified must first be formatted with formatdb. Multiple database names (bracketed by quotations) will be accepted. An example would be -d "Cog Smart" -e Expectation value (E) [Real] default = 10.0 -o BLAST report Output File [File Out] Optional, default = ./blastreport.out ; set by StandAloneBlast.pm Bl2seq -p Program name: blastp, blastn, blastx. For blastx 1st argument should be nucleotide [String] default = blastp -o alignment output file [File Out] default = stdout -e Expectation value (E) [Real] default = 10.0 -S Query strands to search against database (blastn only). 3 is both, 1 is top, 2 is bottom [Integer] default = 3 blastall Title : blastall Usage : $blast_report = $factory->blastall('t/testquery.fa'); or $input = Bio::Seq->new(-id=>"test query", -seq=>"ACTACCCTTTAAATCAGTGGGGG"); $blast_report = $factory->blastall($input); or $seq_array_ref = @seq_array; # where @seq_array is an array of Bio::Seq objects $blast_report = $factory->blastall($seq_array_ref); Returns : Reference to a Blast object containing the blast report. Args : Name of a file or Bio::Seq object or an array of Bio::Seq object containing the query sequence(s). Throws an exception if argument is not either a string (eg a filename) or a reference to a Bio::Seq object (or to an array of Seq objects). If argument is string, throws exception if file corresponding to string name can not be found. blastpgp Title : blastpgp Usage : $blast_report = $factory-> blastpgp('t/testquery.fa'); or $input = Bio::Seq->new(-id=>"test query", -seq=>"ACTADDEEQQPPTCADEEQQQVVGG"); $blast_report = $factory->blastpgp ($input); or $seq_array_ref = @seq_array; # where @seq_array is an array of Bio::Seq objects $blast_report = $factory-> blastpgp(@seq_array); Returns : Reference to a Bio::SearchIO object containing the blast report Args : Name of a file or Bio::Seq object. In psiblast jumpstart mode two additional arguments are required: a SimpleAlign object one of whose elements is the query and a "mask" to determine how BLAST should select scoring matrices see DESCRIPTION above for more details. Throws an exception if argument is not either a string (eg a filename) or a reference to a Bio::Seq object (or to an array of Seq objects). If argument is string, throws exception if file corresponding to string name can not be found. Returns : Reference to Bio::SearchIO object containing the blast report. rpsblast Title : rpsblast Usage : $blast_report = $factory->rpsblast('t/testquery.fa'); or $input = Bio::Seq->new(-id=>"test query", -seq=>"MVVLCRADDEEQQPPTCADEEQQQVVGG"); $blast_report = $factory->rpsblast($input); or $seq_array_ref = @seq_array; # where @seq_array is an array of Bio::Seq objects $blast_report = $factory->rpsblast(@seq_array); Args : Name of a file or Bio::Seq object or an array of Bio::Seq object containing the query sequence(s). Throws an exception if argument is not either a string (eg a filename) or a reference to a Bio::Seq object (or to an array of Seq objects). If argument is string, throws exception if file corresponding to string name can not be found. Returns : Reference to a Bio::SearchIO object containing the blast report bl2seq Title : bl2seq Usage : $factory-> bl2seq('t/seq1.fa', 't/seq2.fa'); or $input1 = Bio::Seq->new(-id=>"test query1", -seq=>"ACTADDEEQQPPTCADEEQQQVVGG"); $input2 = Bio::Seq->new(-id=>"test query2", -seq=>"ACTADDEMMMMMMMDEEQQQVVGG"); $blast_report = $factory->bl2seq ($input1, $input2); Returns : Reference to a BPbl2seq object containing the blast report. Args : Names of 2 files or 2 Bio::Seq objects containing the sequences to be aligned by bl2seq. Throws an exception if argument is not either a pair of strings (eg filenames) or references to Bio::Seq objects. If arguments are strings, throws exception if files corresponding to string names can not be found. _generic_local_blast Title : _generic_local_blast Usage : internal function not called directly Returns : Bio::SearchIO Args : Reference to calling object and name of BLAST executable _runblast Title : _runblast Usage : Internal function, not to be called directly Function: makes actual system call to Blast program Example : Returns : Report Bio::SearchIO object in the appropriate format Args : Reference to calling object, name of BLAST executable, and parameter string for executable _setparams Title : _setparams Usage : Internal function, not to be called directly Function: Create parameter inputs for Blast program Example : Returns : parameter string to be passed to Blast Args : Reference to calling object and name of BLAST executable perl v5.14.2 2012-03-02 Bio::Tools::Run::StandAloneNCBIBlast(3pm)
All times are GMT -4. The time now is 06:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy