Chemistry problem- File matching and Sorting!!!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Chemistry problem- File matching and Sorting!!!
# 1  
Old 07-12-2010
Chemistry problem- File matching and Sorting!!!

Dear Programmers

I have a file called ranking.txt, in which I have 4 chemical compounds in *.sdf file format named ligands_m1, ligands_m2, ligands_m3, ligands_m4.

Each compounds is assigned with a particular score along with the file location.
------------------------------------------------------------------------

Code:
Score           Directory                              Name
37.36       ~/chemscore/ligands_m1/ligands_m1.sdf      ligands_m1
19.35       ~/chemscore/ligands_m2/ligands_m2.sdf      ligands_m2
28.35       ~/chemscore/ligands_m3/ligands_m3.sdf      ligands_m3
30.31       ~/chemscore/ligands_m4/ligands_m4.sdf      ligands_m4

------------------------------------------------------------------------
In the same directory, I have another set of files called cluster files also in the *.sdf format.

I have included the cluster files structure below:

Code:
~/chemscore/ligands_m1/
cluster_ligands_m1_1.sdf
cluster_ligands_m1_2.sdf
cluster_ligands_m1_3.sdf


~/chemscore/ligands_m2/
cluster_ligands_m2_1.sdf
cluster_ligands_m2_2.sdf
cluster_ligands_m2_3.sdf
cluster_ligands_m2_4.sdf
cluster_ligands_m2_5.sdf

~/chemscore/ligands_m3/
cluster_ligands_m3_1.sdf

~/chemscore/ligands_m4/
cluster_ligands_m4_1.sdf
cluster_ligands_m4_2.sdf
cluster_ligands_m4_3.sdf
cluster_ligands_m4_4.sdf

------------------------------------------------------------------------

I need a script that does the following job. For example, ONLY If the score is above 28 and number of cluster files is less than or equal to 3, then write the output.

Code:
Score  Directory                                                Name        Clusters
37.36  ~/chemscore/ligands_m1/ligands_m1.sdf  ligands_m1     3
28.35 ~/chemscore/ligands_m3/ligands_m3.sdf   ligands_m3     1

------------------------------------------------------------------------

Could anybody please help me to sort out this problem?
Thank you in advance.
Robert.

Last edited by pludi; 07-12-2010 at 06:29 AM.. Reason: code tags, please...
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Sorting problem

I have data like this in file Now I have to sort using second column(usage) and i should get first column against it post sorting please provide input (2 Replies)
Discussion started by: mirwasim
2 Replies

2. UNIX Desktop Questions & Answers

Problem in sorting a text file

Hi; I have a text file like this: 1 10 11 2 3 4 M X Y When I sort it numerically using sort -n, it looks like this: Y X M 1 2 3 4 10 (3 Replies)
Discussion started by: a_bahreini
3 Replies

3. Shell Programming and Scripting

TCL script (Molecular Chemistry)

Ok, what about: array set simulation_frames { ... } foreach { frames } { writepdb pdb_$frames.pdb }Now, my question is simply, what strategy could I use to import my numbers into the array { ... } I could manually copy them, and that would work, but is there another way? (2 Replies)
Discussion started by: chrisjorg
2 Replies

4. UNIX for Dummies Questions & Answers

Sorting problem

1) I need to reverse sort the text from lit.csv (bellow) by the second column, then save the last five lines in a text file text.txt but I'm doing something wrong so any help would be much appreciated. I've been trying to use this: sort --field-separator=; -b -k2g,2 lit.csv -o text.txt 2)... (4 Replies)
Discussion started by: Kova
4 Replies

5. UNIX for Dummies Questions & Answers

Sorting file with columns (problem)

Hi all! I am new to Unix programming so bare with me please :). I have saved the output of my results in a file called testfile which contains 3 columns a 15 rows. e.g. 175 754 abvd 948 454 fewf 43 754 fewc 6 734 feww xxx xxx xxxx I want to sort the contents of this file... (10 Replies)
Discussion started by: daelas
10 Replies

6. Shell Programming and Scripting

matching file problem

hi I need help for matching two files a.txt 123,20080921,2419,ec1,20081021 456,20080923,2420,ec1,20081021 789,20080920,2419,ec1,20081021 124,20080921,2421,ec1,20081023 125,20080921,2419,ec1,20081021 126,20080921,2419,ec1,20081021 128,20080921,2419,ec1,20081021 b.txt ... (2 Replies)
Discussion started by: anish19
2 Replies

7. UNIX for Dummies Questions & Answers

Sorting problem

Hai , In unix we are going to sort it out all the directories and files based on size of the file. For that we have to use this command ls -al | sort +4nr. If we are giving this command means it will show all the records in a descending order....when I am checking one file bytes its... (4 Replies)
Discussion started by: cool4naren
4 Replies

8. HP-UX

Sorting problem....

hey mate. ive got a sorting problem that i would like to share... i made a script that sorts the bdf command and redirected the output to a file. the output of the file is: 691416 34% / 851552 7% /stand 7203048 31% /var 23637584 26% /var/adm/crash 2968864 ... (4 Replies)
Discussion started by: jarod004
4 Replies

9. Shell Programming and Scripting

Problem in sorting the file

file format is word filename no.of occurances ------------------------------ wish f3.txt 2 wish f2.txt 1 cold f1.txt 5 cold f2.txt 3 cold f1.txt 3 cold e.txt 3 gold f1.txt 7 gold f3.txt 3 rush e.txt 2 itz abt building a search index for every word in the files given as input the... (1 Reply)
Discussion started by: vishnu_vaka
1 Replies
Login or Register to Ask a Question