General :: Shell Scripting: Getting Multiple Input Files For An Application?

Sep 21, 2010

I am running an application called QuantiSNP [URL]. The binary file is "quantisnp2", called upon in the "run_quantisnp2.sh" supplied by the authors. I am only able to run the application for single file processing (e.g. 1 input file for 1 sample; I can't run the batch file processing because I don't have the necessary BeadStudio report files, which has different formatting for the input files).

The difficulty is that I have 300 samples (300 unique sample IDs) and 3 input files for each sample for a total of 900 runs of this application. I am wondering how would I be able to automate this process as a shell script instead of basically manually changing the sample ID and respective input files every time a run completes? I bolded the single file processing shell script command line options below that need to be changed for each sample/input single file processing run. The command line option "--sampleid" is for the name given to the processed output files corresponding to the sample of interest and there are 3 input files for each sample.

/home2/jason/QuantiSNP/quantisnp/linux64/run_quantisnp2.sh /home2/jason/QuantiSNP/MCR/v79/ --config /home2/jason/QuantiSNP/quantisnp/config/params.dat --levels /home2/jason/QuantiSNP/quantisnp/config/levels-affy.dat --outdir /home2/jason/QuantiSNP/quantisnp_out/ --sampleid sample1 --gender female --input-files /home2/jason/files/sample1_input.txt

Note that each sample has 3 input files, for a total of 3 runs of "quantisnp2" for each sample. e.g.

SAMPLEID INFILE
sample1 /home2/jason/files/sample1_input.txt
sample1 /home2/jason/files/sample1_input2.txt
sample1 /home2/jason/files/sample1_input3.txt

[code]....

View 7 Replies


ADVERTISEMENT

Programming :: Shell Scripting For Accepting Input From Different Directories Automatically

Nov 6, 2010

The two shell scripts (t1prog and t2prog) are given below they are working fine. The input for the first program is 't1.det' and for second program is 't1.rnaml'. These two input files are in 'dir1' folder. I am executing the shell like 'sh t1prog > t1out' and 'sh t2prog > t2out' from this directory only. Then I am executing a java program 'java RNA'; for this, t1out and t2out are input files used in the program and I am getting the final output on screen.

The input files 't1.det' and 't1.rnaml' are in different folders with same name and with different values. Each folder specifies one gene sequence input files.

In mfold directory there are 5 directors and each directory contains these input files as shown below
cd mfold
dir1 dir2 dir3 dir4 dir5
cd dir1
t1.det t1.rnaml

[Code].....

for inputs in different directories and executing these and redirecting the final ouput after executing 'java RNA' statement to a file is needed.

View 2 Replies View Related

General :: Shell Scripting - Compare Strings From Two Different Simple .txt Files?

Jul 29, 2010

what command is to be used to call strings from other files to the script and then comparing strings from two different files in the script to check if strings are matched then return the result to another script.

View 1 Replies View Related

General :: Read From Input File And Append To Multiple Files?

Nov 22, 2010

I wanted to be as clear as possible. I have to add hundreds of new servers to hundreds of configuration files in Nagios. Here is a sample structure:

servers.txt has:
SERVER3
SERVER4

[code]....

View 10 Replies View Related

Software :: Reading Files In Shell Scripting?

Oct 25, 2010

I am trying to read the fields of a file and manipulate them, record by record. Lets say using awk :

awk -F":" `{print $1 $2 $3 $4 $5}' TrackMsgFile.0806`

This prints my fields on screen.But I dont want to print these fields while reading the records instead store them in some variable and manipulate them as per my logic. Does "awk" or some other shell command provides something for this ?

View 14 Replies View Related

General :: Create A Multiple Files By Reading A Input File And Changing The Contents?

Sep 16, 2009

Being new to this area .I have been assigned a task which i am unable to do . Can any one please help me .

I have requirement where i have input file XYZ_111_999_YYYYMMDD_1.TXT and with header and series of Numbers and Footer.

I want to create a mutiple output files with each file having a seperate code which is stored in text file and create XYZ_222_999_YYYYMMDD_1.TXT . and add date in the contents next to series of numbers .Like this

Before change the file looks like this

file name XYZ_111_999_YYYYMMDD_1.TXT

001,19SEP2009-14:05:05,000000003
1234
4567
6785
END_OF_DATA

[Code]....

View 4 Replies View Related

Programming :: Compare Two Files Using Perl Or Shell Scripting?

Mar 8, 2010

I want to compare the following two tab-delimited .txt files (both were subsets of the original files) by comparing Columns 3 and 4 simultaneously. It is easy to compare C3 because both C3s are just numbers. But how to compare C4s?Basically, in File1, "G,G" = G in File2, "C,C" = C in File2, "A,A" = A in File2, "T,T"= T in File2.In File2, A/T in Column4 just equals "A,T" or "T,A" in Column4 of File1. C/T in Column4 just equals "C,T" or "T,C" in Column4 of File1, and etc.

File1:

C1C2 C3C4
ih509rs12345467244750"G,G"
ih499rs6049687244911"C,C"
ih508- 7244977"A,A"

[code]....

View 2 Replies View Related

Programming :: Execute Multiple Sql Files Using Scripting?

May 19, 2010

My query is i have a.sql , b.sql , c.sql files which needs to be executed using "$ db2 -tvf a.sql"; "$ db2 -tvf b.sql"; "$db2 -tvf c.sql" , script with which i can execute all these sql files in a single shot.

View 4 Replies View Related

Programming :: Bash Scripting - Output As Multiple Files?

Jan 26, 2011

I have wrote a 1 line command that parses a file, locates the IP Address in the file and then trims the output the way I want it, and then sorts numerically and by uniqueness and then >> appends to output.txt

I can get all the IP's into 1 file "output.txt", but what I am really looking for is some type of way to create a text file, for each IP it finds labeled xxx.xxx.xxx.xxx.txt and also put that ip address into that file..

xxx.xxx.xxx.xxx = the ip address it finds

View 14 Replies View Related

General :: What Is Shell Scripting?

Feb 15, 2011

What is shell scripting? what is 'bash'?

View 14 Replies View Related

General :: Any Projects On Shell Scripting?

Dec 6, 2010

Just give me any project on shell scripting .. to start working on it and practice my self ..

View 2 Replies View Related

General :: First Line In Shell Scripting?

Feb 15, 2011

I am a bit confused with the first line while writing a shell script , if someone can please explain me the meaning of the first line " #!/bin/bash "the confusion for me is the # at the beginning , in shell scripting # means a comment. but in this case it loads the shell which the script must use,instead of commenting the line how is this possible. where is this defined , any particular file.

View 3 Replies View Related

General :: Global Expressions Using Vi And Shell Scripting?

Jul 29, 2010

I am trying to learn more about global expressions and how it is needed in changing stuff in vi and in shell scipting in general.My question is basic:

How can I add a " # " pound sign at the beginning of every line in a file. So if I want to remark out every line in a file, what would be the global expression for that? Is there a global expression cheat sheet?

View 4 Replies View Related

General :: Shell Scripting - For Each File In Directory

May 2, 2011

I am working on some homework, however i am not here to be spoon fed. I am trying to get the numerical modification date of each file in a folder. Ie lets say there is a file called bob and it was modified 2006-11-23. i want to get it into a variable as 20061123.

Now i currently have this code:

Code:

However for some reason my output is:

Quote:

See how the 2011 has been placed next to it? i ran it with -x and saw this:

Code:

However i do not know how to find a way around this?

View 11 Replies View Related

General :: Bash Shell Scripting Request?

Feb 27, 2011

I am working on a simple script that should take two command line arguments, a [number] and a [name]. The first thing the script should do is check to make sure that no more and no less than two command line arguments have been entered when calling the script - an error message should be delivered if the condition is not true.

If two args have been entered, then the message 'processing "scriptname"' should appear, where scriptname is the name of the script being called. The script should then write to the screen "Hi [name]!", and should write this phrase [number] of times. For example, the command $ myscript 2 joe would produce the output: I have read the manual many times looking for examples, and I am very close by virtue of my own efforts. Further, I have searched these forums and others for good examples, which have also gotten me very close. Still my script is not completing the objective, and I am wondering if someone could point me in the right direction. Script:

[Code]...

View 13 Replies View Related

General :: Learn Shell Scripting And Came Up With A Lil First Script?

Jan 26, 2011

I am trying to learn shell scripting and came up with a lil first script that I could actually use.I have a basic shell script and all it does is run:

sudo apt-get update
sudo apt-get upgrade

So basically just a shell script that updates your packages. NOW, my question. I made another shell script that makse a bit of a menu and asks what you wanna do, 1 to UPDATE or 2, to CLOSE. How do I make it so when they enter 1 it runs my update.sh ?

View 6 Replies View Related

Software :: Export A Variable To Parent Shell In Shell Scripting?

May 21, 2009

Is there a way to export a variable to parent shell in shell scripting ?

View 3 Replies View Related

Programming :: Shell Scripting / Create A Shell Script Similar To Ls?

Jun 5, 2011

I am trying to create a shell script similar to ls, but which only lists directories. I have the first half working (no argument version), but trying to make it accept an argument, I am failing. My logic is sound I think, but I'm missing something on the syntax.

Code:
if [ $# -eq 0 ] ; then
d=`pwd`
for i in * ; do
if test -d $d/$i ; then
echo "$i:"
code....

View 10 Replies View Related

General :: Incrementing Array Element In Shell Scripting

Jun 23, 2010

ch[1]=0; ch[2]=0; ch[3]=0; ch[4]=0; ch[5]=0; ch[6]=0; ch[7]=0; ch[8]=0; ch[9]=0; ch[10]=0;ch[11]=0; ch[12]=0; ch[13]=0; ch[14]=0; ch[15]=0 ch[16]=0; ch[17]=0; ch[18]=0; ch[19]=10; ch[20]=0;

I have an array ch and I want to increment each element in my array for the following if statement. I'm not sure I have the right array increment syntax but I have tried it in different ways ant it doesn't seem to work.

I tried ch[$1]++, ch[$1]+1, ch[$1++], ch[$1]+=1, ch[$1]=ch[$1]+1 none of these seem to work.
# while loop reading from read.txt for check list 1 - 15
for i in `seq 15`
do
a=`grep "${cl[$i]}" $file`
status=$?
if [[ $status = 0 ]];
then
echo -n -e "1 "
let ch[$i+1]
let k++
else
echo -n -e "0 "
fi
done
for l in `seq 20`
do
echo -n -e "${ch[$l]} "
done

View 2 Replies View Related

General :: Write Either PYTHON Or Bash Shell Scripting?

Jun 4, 2010

I do not know how to write either PYTHON or Bash Shell Scripting. I am to learn one for Linux Administration purpose. Which one will you recommend for a Linux Admin/Eng environment?

View 4 Replies View Related

General :: Randomly Select Folder Using Shell Scripting

Jun 17, 2011

There are five folders in a folder and I want to select one randomly. I used this command:

Code:
rand1="${loc[RANDOM % ${#loc[@]}]}"

but it selects files too. I have no idea about this code even. I found it on a forum.

View 7 Replies View Related

General :: Shell Scripting Text File Creation ?

Feb 16, 2011

I'm just starting out with shell-scripting, but having a problem with making new text files with the touch or cat > commands.

What I've been doing is touch testfile1.txt

Also, I've tried cat > testfile1.txt (text)

Console reports "bash: text1.txt: No such file or directory. Consfusingly, it works fine in the home-directory. But if I move the file to where I want it, I can no longer view, edit, etc. it.

View 1 Replies View Related

General :: Shell Scripting: Parse Parameters From Command Line?

Mar 12, 2010

myscript [-a a-arg] [-c c-arg] [-b] [-e] somedirectory

Given that I want my shell script be invoked at the command line using the above parameters - where [these brackets] denote that they are optional - what is the best method to parse them?

View 1 Replies View Related

General :: Create A Menu Box Window Using Dialog In Shell Scripting

Feb 3, 2010

I am using Linux on my system. I don't have gui for my system, only console is there.

I have some task to create a menu box window using dialog in shell scripting.

I have to take input from user & save it in a file.

But this should like html form as e.g.

Name - .....................
email id - ..................
phone - ......................
location - ...................

Submit Cancel

Such window should be displayed on console using dialog & then user will enter his information there as Name,email id, phone,etc & submit it, then it gets saved to a file. Here submit & cancle are buttons. I have to do it in bash shell scripting. Or give me some examples like the above with shell script code.

View 1 Replies View Related

General :: Delete A File On A Remote Server Using Shell Scripting?

Jul 18, 2010

delete a file on a remote server using shell scripting.

View 14 Replies View Related

General :: Shell Scripting: Inserting Text Into A File Name With A Predictable Pattern

Apr 18, 2011

Just using shell scripting, how can I insert text into the middle of a file name. The file has a predictable pattern, let's say 3 letters and 3 numbers and I want to insert text in the middle of those 2 patterns. Say ABC123 is the file name. As a result, the file name should be ABC.blah.123

View 2 Replies View Related

General :: Script (Case & IF Statement Syntax) - Easy To Answer If Know Shell Scripting

May 6, 2011

Im a bit stuck with a simple script that im practicing with... im trying to get my head around some simple scripting. Basically i want to write a script that will work as below: It will ask the user to enter their userid. If its correct it will say 'Correct' If its the wrong id (But the ID exists in /etc/passwd) then it will say 'incorrect' If its not a valid userid it will say 'doesnt exist'. What i have so far is:

[Code]...

# If the user enters their own userid they will get a comment saying 'correct' $LOGNAME) echo "Correct";;

# If they enter another users ID (That exists in the /etc/passwd), then they get a message to say 'incorrect userid used'. Im not sure what i need to do here to get it to check the /etc/passwd to see if the input exists in there.... im guessing some kind of simple 'if' statement to say ---- "if 'input' exists in /etc/passwd then echo "incorrect userid used"

# If its entered incorrectly and not a valid ID then they will get this comment. Again, im guessing this part would be similar to te above option..... *) echo "not a valid ID";;

Ive managed to work out how the basic Case staements work, but to add a conditional statement based on the input, i just cant figure out. I have tried looking on google, and found some help but it doesnt really explain how i check the input against the /etc/passwd.

View 17 Replies View Related

General :: System Administration Scripting - Write Very Basic BASH Shell Scripts

Jan 10, 2011

I'd like to know some good resources, links, e-books to learn basic Linux system administration scripting. I know how to write very basic BASH shell scripts so I'm still at beginner level. There are so many docs out there that I'd like to narrow down people's opinion's on the best easy to understand resources that are available. Eventually I'd like to learn basic PERL as well.

View 3 Replies View Related

Ubuntu :: Comparing Multiple Files In Shell Script?

Jun 13, 2010

I've got an interesting challenge for the shell scripting wizards here. I've got a mySQL dump of three files for my amarok database with the intention of copying some files to my media server (cover art) so that I can keep the server the server and not rely on my local machine.

Step 1: Identify any cover art files on my local machine.

I did this with:

Code:
mysql -u amarok -p amarok -e "SELECT * FROM images WHERE path like '%.kde%'" > cover_art.txt
Output looks like this:

[Code]....

What I have here now is the ENTIRE album list in my collection -- and something to compare the IDs in Step 1 against. I'm going to stop here and will update the thread as I get past this stumbling block. "ID" in cover_art.txt = "image" in albums.txt... straightforward enough, right?

So the question is this: how do I create a simple shell script that will loop through the IDs in cover_art.txt (i.e. characters 0 -> 4 -- it will always be a 4 digit ID) and then search for that ID in the Albums.txt file.

View 3 Replies View Related

General :: Scripting - Feed An Input File Into An If Statement Line-by-line

Dec 23, 2009

I am trying to write a script that takes an input file ($FileName) and an intermediate file ($FileName.info) and removes lines from $FileName if the value in $2 of $FileName.info is <75.

I can't figure out how to feed only one line of the .info file to the if statement at a time so that it will perceive it as an integer instead of a list.

The error I am getting now is ./script.sh: line 6: [: : integer expression expected

Sample input $FileName

Code:

Code:

Code:

Script so far:

Code:

View 10 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved