Netiquette · Download · News · Gallery · Homepage · DSSR Manual · G-quadruplexes · DSSR-Jmol · DSSR-PyMOL · DSSR Licensing · Video Overview· RNA Covers

Author Topic: Ruby scripts / where is output file?  (Read 14034 times)

Offline shahabshariati

  • with-posts
  • *
  • Posts: 10
    • View Profile
Ruby scripts / where is output file?
« on: February 10, 2011, 09:32:10 am »
Dear all

I want to use Ruby scripts for obtaining helical parameters of dna during md simulation.

at first, I downloaded from http://3dna.rutgers.edu:8080/data/x3dna_md_v0.1.tar.gz.

I installed that in /root/3dna such as after installation, /root/3dna/x3dna_md_v0.1

I obtained bpfile.dat by find_pair :

3dna.pdb
3dna.out
    2         # duplex
   13         # number of base-pairs
    1    1    # explicit bp numbering/hetero atoms
    1   26  0 #    1 | ...1>-:...1_:[DC5]C-----G[DG3]:..26_:-<...1
    2   25  0 #    2 | ...1>-:...2_:[.DA]A-----T[.DT]:..25_:-<...1
    3   24  0 #    3 | ...1>-:...3_:[.DC]C-----G[.DG]:..24_:-<...1
    4   23  0 #    4 | ...1>-:...4_:[.DT]T-----A[.DA]:..23_:-<...1
    5   22  0 #    5 | ...1>-:...5_:[.DA]A-----T[.DT]:..22_:-<...1
    6   21  0 #    6 | ...1>-:...6_:[.DA]A-----T[.DT]:..21_:-<...1
    7   20  0 #    7 | ...1>-:...7_:[.DT]T-----A[.DA]:..20_:-<...1
    8   19  0 #    8 | ...1>-:...8_:[.DT]T-----A[.DA]:..19_:-<...1
    9   18  0 #    9 | ...1>-:...9_:[.DG]G-----C[.DC]:..18_:-<...1
   10   17  0 #   10 | ...1>-:..10_:[.DA]A-----T[.DT]:..17_:-<...1
   11   16  0 #   11 | ...1>-:..11_:[.DA]A-----T[.DT]:..16_:-<...1
   12   15  0 #   12 | ...1>-:..12_:[.DG]G-----C[.DC]:..15_:-<...1
   13   14  0 #   13 | ...1>-:..13_:[DG3]G-----C[DC5]:..14_:-<...1
##### Base-pair criteria used:   4.00   0.00  15.00   2.50  65.00   4.50   7.50 [ O N]
##### 0 non-Watson-Crick base-pairs, and 1 helix (0 isolated bps)
##### Helix #1 (13): 1 - 13

the name of pdb file is 3dna.pdb (containing 41 models)

I put bpfile.dat and 3dna.pdb files in /root/3dna/x3dna_md_v0.1.

I used following command like what is in viewtopic.php?f=11&t=195.

./x3dna_md.rb -b bpfile.dat -e 3dna.pdb -o 3dna.out after that I have:

        3dna.pdb: with model numbers <= 0
Process model #0 / 41
./x3dna_md.rb:94:in `each': no block given (LocalJumpError)
        from ./x3dna_md.rb:94:in `parse_base_pair_parameters'
        from ./x3dna_md.rb:466:in `each_with_index'
        from ./x3dna_md.rb:93:in `each'
        from ./x3dna_md.rb:93:in `each_with_index'
        from ./x3dna_md.rb:93:in `parse_base_pair_parameters'
        from ./x3dna_md.rb:201:in `parse_3dna_output'
        from ./x3dna_md.rb:198:in `open'
        from ./x3dna_md.rb:198:in `parse_3dna_output'
        from ./x3dna_md.rb:279:in `process_ensemble_models'
        from ./x3dna_md.rb:270:in `each'
        from ./x3dna_md.rb:270:in `process_ensemble_models'
        from ./x3dna_md.rb:77:in `main'
        from ./x3dna_md.rb:495

there is no error but I didn't find my output file (3dna.out)

is my manner true?

please guide me about finding of output file.

best regrads

Offline xiangjun

  • Administrator
  • with-posts
  • *****
  • Posts: 1640
    • View Profile
    • 3DNA homepage
Re: Ruby scripts / where is output file?
« Reply #1 on: February 10, 2011, 10:19:44 pm »
Thanks for trying out the Ruby scripts for MD trajectories  analysis with 3DNA. To help debug the problems you experienced, please try the following:
  • What version of Ruby you have? i.e., what "[red:2pf22pld]ruby -v[/red:2pf22pld]" outputs? Which OS are you using?
  • What happens if you run the sample dataset distributed with the Ruby scripts? i.e., in the installed directory, run:
    [pre:2pf22pld][red:2pf22pld]./x3dna_md.rb -b bpfile.dat -e sample_md0.pdb[/red:2pf22pld][/pre:2pf22pld]Does it work, or give any error message?
  • Please attach your PDB file, so others can reproduce your problem.
Xiang-Jun

Offline shahabshariati

  • with-posts
  • *
  • Posts: 10
    • View Profile
Re: Ruby scripts / where is output file?
« Reply #2 on: February 12, 2011, 02:46:19 am »
Dear xiangjun

thanks for your attention.

I downloaded x3dna_md_v0.1.tar.gz.

ruby -v ===> ruby 1.8.5 (2006-08-25) [x86_64-linux]

my OS is : x86_64 x86_64 x86_64 GNU/Linux Red Hat Enterprise Linux Server release 5 (Tikanga)

if I run the sample dataset distributed with the Ruby scripts (./x3dna_md.rb -b bpfile.dat -e sample_md0.pdb),

yes, it does work and didn't give any error:


[root@localhost x3dna_md_v0.1]# ./x3dna_md.rb -b bpfile.dat -e sample_md0.pdb
        sample_md0.pdb: with model numbers <= 0
Process model #0 / 21
./x3dna_md.rb:94:in `each': no block given (LocalJumpError)
        from ./x3dna_md.rb:94:in `parse_base_pair_parameters'
        from ./x3dna_md.rb:466:in `each_with_index'
        from ./x3dna_md.rb:93:in `each'
        from ./x3dna_md.rb:93:in `each_with_index'
        from ./x3dna_md.rb:93:in `parse_base_pair_parameters'
        from ./x3dna_md.rb:201:in `parse_3dna_output'
        from ./x3dna_md.rb:198:in `open'
        from ./x3dna_md.rb:198:in `parse_3dna_output'
        from ./x3dna_md.rb:279:in `process_ensemble_models'
        from ./x3dna_md.rb:270:in `each'
        from ./x3dna_md.rb:270:in `process_ensemble_models'
        from ./x3dna_md.rb:77:in `main'
        from ./x3dna_md.rb:495

Offline shahabshariati

  • with-posts
  • *
  • Posts: 10
    • View Profile
Re: Ruby scripts / where is output file?
« Reply #3 on: February 12, 2011, 03:16:24 am »
Dear xiangjun

excuse me.

when I use ./x3dna_md.rb -b bpfile.dat -e sample_md0.pdb  for sample dataset, I encountered

./x3dna_md.rb:94:in `each': no block given (LocalJumpError)

how to fix it?

Offline xiangjun

  • Administrator
  • with-posts
  • *****
  • Posts: 1640
    • View Profile
    • 3DNA homepage
Re: Ruby scripts / where is output file?
« Reply #4 on: February 12, 2011, 11:57:21 am »
Quote from: "shahabshariati"
./x3dna_md.rb:94:in `each': no block given (LocalJumpError)
You've helped me catch a 'potential' bug -- after googling for the error message, and checked the code, I believe I have fixed it.

Just for the record, here is an example where the change has been made: ([red:qc42htwt].each.collect[/red:qc42htwt] to [red:qc42htwt].collect[/red:qc42htwt])

Code: [Select]
pars[p] = parmtx.each.collect {|x| x[i]}
----->
pars[p] = parmtx.collect {|x| x[i]}
The tricky part is that the error message did not show up in Ruby 1.9.2p0 on Ubuntu Linux (10.04) and 1.8.7 on Mac OS X Snow Leopard where I tested the scripts initially. Apparently, for the new versions of Ruby, [red:qc42htwt].each.collect[/red:qc42htwt] just introduces an extra loop over the list, which does no harm to the result. Put another way, you would not have noticed the 'bug' if you had used Ruby 1.8.7, or 1.9.x.

Download and reinstall the revised script v0.2, and report back what you get; I will be surprised if you still have the same problem  :oops:

As always, I welcome bug reports -- the more, the merrier!

Xiang-Jun

Offline shahabshariati

  • with-posts
  • *
  • Posts: 10
    • View Profile
Re: Ruby scripts / where is output file?
« Reply #5 on: March 08, 2011, 07:41:30 am »
Dear xiangjun

very thanks for your reply.

excuse me for delay in my feedback.
I downloaded and reinstalled the revised script v0.2.

When I run the sample dataset distributed with the Ruby scripts (./x3dna_md.rb -b bpfile.dat -e sample_md0.pdb),
it does work and x3dna_md.out was created.

after that I used Ruby scripts for my MD trajectory.

I attached pdb file (dna.pdb). It contains 10 models.

my bpfile.dat is as follows:

dna.pdb
dna.out
    2         # duplex
   13         # number of base-pairs
    1    1    # explicit bp numbering/hetero atoms
    1   28  0 #    1 | A:...1_:[DC5]C-----G[DG3]:..26_:A  0.20  0.00  0.05  9.04 -1.30
    2   27  0 #    2 | A:...2_:[.DA]A-----T[.DT]:..25_:A  0.09  0.05  1.13  9.08 -1.30
    3   26  0 #    3 | A:...3_:[.DC]C-----G[.DG]:..24_:A  0.20  0.00  0.06  9.04 -1.30
    4   25  0 #    4 | A:...4_:[.DT]T-----A[.DA]:..23_:A  0.09  0.06  1.13  9.08 -1.30
    5   24  0 #    5 | A:...5_:[.DA]A-----T[.DT]:..22_:A  0.09  0.05  1.13  9.08 -1.30
    6   23  0 #    6 | A:...6_:[.DA]A-----T[.DT]:..21_:A  0.09  0.05  1.14  9.08 -1.30
    7   22  0 #    7 | A:...7_:[.DT]T-----A[.DA]:..20_:A  0.09  0.05  1.12  9.08 -1.30
   10   21  0 #    8 | A:...8_:[.DT]T-----A[.DA]:..19_:A  0.09  0.06  1.14  9.08 -1.30
   11   20  0 #    9 | A:...9_:[.DG]G-----C[.DC]:..18_:A  0.20  0.00  0.08  9.04 -1.30
   12   19  0 #   10 | A:..10_:[.DA]A-----T[.DT]:..17_:A  0.09  0.06  1.14  9.08 -1.30
   13   18  0 #   11 | A:..11_:[.DA]A-----T[.DT]:..16_:A  0.09  0.05  1.13  9.08 -1.30
   14   17  0 #   12 | A:..12_:[.DG]G-----C[.DC]:..15_:A  0.20  0.00  0.07  9.04 -1.30
   15   16  0 #   13 | A:..13_:[DG3]G-----C[DC5]:..14_:A  0.20  0.00  0.07  9.04 -1.30
##### Base-pair criteria used:   4.00 15.00  2.50 65.00  4.50  7.50
##### 0 non-Watson-Crick base-pairs, and 1 helix (0 isolated bps)
##### Helix #1 (13): 1 - 13  ***broken O3' to P[i+1] linkage***


I used following command:

./x3dna_md.rb -b bpfile.dat -e dna.pdb

after that I have:

Process model #15 / 10
./x3dna_md.rb:96:in `parse_base_pair_parameters': undefined method `[]' for nil:NilClass (NoMethodError)
        from ./x3dna_md.rb:96:in `collect'
        from ./x3dna_md.rb:96:in `parse_base_pair_parameters'
        from ./x3dna_md.rb:468:in `each_with_index'
        from ./x3dna_md.rb:95:in `each'
        from ./x3dna_md.rb:95:in `each_with_index'
        from ./x3dna_md.rb:95:in `parse_base_pair_parameters'
        from ./x3dna_md.rb:203:in `parse_3dna_output'
        from ./x3dna_md.rb:200:in `open'
        from ./x3dna_md.rb:200:in `parse_3dna_output'
        from ./x3dna_md.rb:281:in `process_ensemble_models'
        from ./x3dna_md.rb:272:in `each'
        from ./x3dna_md.rb:272:in `process_ensemble_models'
        from ./x3dna_md.rb:79:in `main'
        from ./x3dna_md.rb:497

no output file was ctreated.

how to fix it? please guide me about that.

best regards.

Offline shahabshariati

  • with-posts
  • *
  • Posts: 10
    • View Profile
Re: Ruby scripts / where is output file?
« Reply #6 on: March 08, 2011, 07:43:42 am »
excuse me I forgot to attach dna.pdb file. I did to this post.

Offline xiangjun

  • Administrator
  • with-posts
  • *****
  • Posts: 1640
    • View Profile
    • 3DNA homepage
Re: Ruby scripts / where is output file?
« Reply #7 on: March 09, 2011, 08:31:16 pm »
Since the scripts work (as designed) with the distributed example, yet not in your case,  please verify that your setting is correct. Specifically, make sure that your supplied base-pair file matches the model in your ensemble PDB file.

Please report back how it turns out.

Xiang-Jun

Offline shahabshariati

  • with-posts
  • *
  • Posts: 10
    • View Profile
Re: Ruby scripts / where is output file?
« Reply #8 on: March 16, 2011, 04:24:40 am »
Dear xiangjun

very thanks for your attention

I installed x3dna_md_v0.3.tar.gz again and then I ran the sample dataset distributed with the Ruby scripts as follows:

 tar -xvzf x3dna_md_v0.3.tar.gz

 cd x3dna_md_v0.3

export X3DNA=/root/ruby_x3dna/X3DNA

 ./x3dna_md.rb -b bpfile.dat -e sample_md0.pdb

output file (x3dna_md.out ) was created but there is a problem.

I attached my output file named my.out.

in my.out file the value of parameter relating to every base pair is the same during trajectory

x3dna_md.out :

<phase1>      # with 12 data columns
0   127.6   105.2   139.4   155.4   136.8   93.2   17.4   137.5   163.8   141.1   152.7   126.5
1   132.1   85.2   141.0   156.7   98.9   124.3   115.7   124.7   115.8   81.8   126.8   86.6
2   158.2   105.0   135.7   154.0   112.6   140.1   95.6   126.1   115.0   125.2   125.0   110.1
3   121.8   127.3   122.8   105.0   115.6   112.6   106.4   150.4   121.6   122.3   104.0   143.9
4   120.1   152.3   154.9   148.1   135.1   107.0   93.1   86.2   121.3   149.9   164.3   118.3
5   144.3   121.9   160.5   101.7   104.4   114.5   117.3   128.8   98.1   116.1   162.2   148.1
6   162.1   146.9   109.9   106.4   124.1   161.0   102.3   118.7   176.6   130.8   171.1   102.7
7   141.4   180.6   120.8   6.0   149.3   130.6   122.7   117.7   66.4   155.4   84.4   162.3
8   168.8   176.5   109.0   142.3   187.4   74.1   121.6   106.6   140.8   117.6   21.5   172.5
9   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
10   128.7   162.7   144.6   95.4   102.0   114.5   134.4   127.7   129.2   107.0   127.8   94.4
11   138.4   143.1   81.5   139.5   109.0   128.9   99.1   83.6   355.0   165.9   109.0   120.0
12   107.0   141.5   145.2   90.3   70.0   135.2   161.8   122.9   99.5   136.1   109.8   109.8
13   137.9   120.4   99.4   130.6   121.2   119.0   80.5   124.6   138.5   95.2   69.3   159.1
14   138.0   113.5   116.2   131.7   100.6   56.8   356.3   152.2   137.4   147.8   50.8   163.1
15   135.1   136.4   109.1   127.4   96.4   147.5   111.6   78.8   122.5   133.8   131.5   126.2
16   155.3   105.7   126.9   120.1   165.8   91.1   138.0   147.2   113.5   130.8   123.9   147.8
17   120.1   170.0   46.7   108.2   129.6   68.5   140.5   153.1   133.2   134.7   98.1   158.7
18   135.7   155.0   181.0   111.7   123.8   106.2   187.6   144.1   110.2   113.1   115.9   186.8
19   98.6   136.2   168.8   131.1   149.3   15.1   147.0   152.9   163.0   95.1   138.6   134.9
20   139.6   150.0   144.0   118.9   127.5   116.5   113.0   107.6   55.1   127.8   110.7   181.6
</phase1>

my.out:

<phase1>      # with 12 data columns
0   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
1   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
2   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
3   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
4   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
5   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
6   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
7   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
8   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
9   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
10   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
11   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
12   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
13   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
14   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
15   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
16   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
17   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
18   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
19   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
20   134.6   133.8   128.8   106.4   91.2   104.7   100.0   98.4   114.6   14.5   358.6   170.8
</phase1>

is my manner wrong?

please guide me about that

best regrads

Offline xiangjun

  • Administrator
  • with-posts
  • *****
  • Posts: 1640
    • View Profile
    • 3DNA homepage
Re: Ruby scripts / where is output file?
« Reply #9 on: April 02, 2011, 10:11:49 pm »
I was unable to reproduce your problem where in the output file "the value of parameter relating to every base pair is the same during trajectory".

As a followup of my reply (dated Wed Mar 09, 2011) to your post dated Tue Mar 08, 2011, did you realize that your base-pair file "bpfile.dat" does not match your PDB file "dna.pdb". Specifically, the first two base-pair lines in "bpfile.dat" read as below:

[pre:356ija09]1 [red:356ija09]28[/red:356ija09] 0 # 1 | A:...1_:[DC5]C-----G[DG3]:..26_:A 0.20 0.00 0.05 9.04 -1.30
2 [red:356ija09]27[/red:356ija09] 0 # 2 | A:...2_:[.DA]A-----T[.DT]:..25_:A 0.09 0.05 1.13 9.08 -1.30[/pre:356ija09]
However, your PDB data file "dna.pdb" has only 26 nucleotides. In other words, there are no nucleotides #27 and #28 in your PDB file at all.
[hr:356ija09][/hr:356ija09]
Over the past few weeks, I have used your example and other feedbacks I received to further refine the scripts. Now updated to v0.5, the scripts are much more robust;  they provide sensible error message if requirements are not met (e.g., with unmatched base-pair as in your case). All identified issues have been resolved.

Please have a try and report back how it goes.

HTH,

Xiang-Jun

Offline shahabshariati

  • with-posts
  • *
  • Posts: 10
    • View Profile
Re: Ruby scripts / where is output file?
« Reply #10 on: April 05, 2011, 05:15:27 am »
Dear xiangjun

I installed x3dna_md_v0.3 again.

after installation, in x3dna_md_v0.3 directory, as you know there are input files (bpfile.dat and sample_md0.pdb) and output file x3dna_md.out.


I used same input files (bpfile.dat and sample_md0.pdb) as follows:


./x3dna_md.rb -b bpfile.dat -e sample_md0.pdb -o my.out


unfortunately in my output file (my.out) the value of parameter relating to every base pair is the same during trajectory.

I attached both of x3dna_md.out and my.out files.

what is reason of this problem?

Offline temizna

  • with-posts
  • *
  • Posts: 19
    • View Profile
Re: Ruby scripts / where is output file?
« Reply #11 on: April 06, 2011, 11:04:54 am »
You may have a path issue. Try running like this:
term> ruby x3dna_md.rb -b bpfile.dat -e sample_md.pdb -o my.out

Make sure you are calling the correct ruby from the correct place and the X3DNA environment variable is set.
HTH,
Alpay

Offline shahabshariati

  • with-posts
  • *
  • Posts: 10
    • View Profile
Re: Ruby scripts / where is output file?
« Reply #12 on: April 07, 2011, 09:00:58 am »
Dear temizna

thanks for your reply

I tried by : ruby x3dna_md.rb -b bpfile.dat -e sample_md.pdb -o my.out

but problem was not solved.

I did installation again:

I put x3dna_md_v0.3.tar.gz in /root/parameter directory.

tar -xvzf x3dna_md_v0.3.tar.gz

cd x3dna_md_v0.3

when type ./x3dna_md.rb,

X3DNA environment variable not set.

I used: X3DNA=/root/parameter/x3dna_md_v0.3/X3DNA; export X3DNA

then I typed  ruby x3dna_md.rb -b bpfile.dat -e sample_md0.pdb -o my.out

unfortunately problem was not solved and again, the value of parameter relating to every base pair is the same during trajectory.

please guide me to solve my problem.

best regards.

Offline xiangjun

  • Administrator
  • with-posts
  • *****
  • Posts: 1640
    • View Profile
    • 3DNA homepage
Re: Ruby scripts / where is output file?
« Reply #13 on: April 08, 2011, 07:56:14 pm »
Did you read my reply dated Apr 02? Do you know that the Ruby scripts are built on top of 3DNA -- i.e. you should already have a valid 3DNA (preferably v2.0) installed? When you said that "unfortunately in my output file (my.out) the value of parameter relating to every base pair is the same during trajectory", did you bother to check which base-pair is being repeated, and wondering why that bp specifically, not another one? Without being able to reproducing your problem, I really cannot offer you any concrete suggestion. Please ask a local expert (in Unix) for help. In any event, you have full access to the Ruby scripts to dig to the bottom of the problem.

Also as suggested in my previous reply (Apr 02), please update to the current version [red:3pnrsf1p]v0.5[/red:3pnrsf1p], follow carefully the instructions in the [red:3pnrsf1p]README[/red:3pnrsf1p] file, and report back explicitly what happens. The v0.5 scripts are designed to check more vigorously their prerequisites and complain loudly if the requirements are not met.

HTH,

Xiang-Jun

 

Created and maintained by Dr. Xiang-Jun Lu [律祥俊] (xiangjun@x3dna.org)
The Bussemaker Laboratory at the Department of Biological Sciences, Columbia University.