[gmx-users] Ramachandran Plot for a Polymer

2019-09-11 Thread Shan Jayasinghe
Dear Gromacs Users,

Can we get the Ramachandran plot for a polymer using Gromacs? If we can,
how do we do that? Appreciate your help.

Thank you.
-- 
Best Regards
Shan Jayasinghe
-- 
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.


Re: [gmx-users] ramachandran plot

2019-01-10 Thread zaved
> Message: 4
> Date: Wed, 9 Jan 2019 11:59:31 +0100
> From: Tamas Hegedus 
> To: gromacs.org_gmx-users@maillist.sys.kth.se
> Subject: Re: [gmx-users] ramachandran plot
> Message-ID: <563a0c65-532e-a47d-fdf7-5046a062c...@hegelab.org>
> Content-Type: text/plain; charset=utf-8; format=flowed

Hi Tamas

Thank you so much for your suggestion. I will check that. Just to know one
more thing, is there any program to know only number of residues in the
allowed and favoured region in the output?

Thank You

> Hi,
>
> I use the python MDAnalysis packages for this.
>
> https://github.com/MDAnalysis/mdanalysis/issues/1335
>
> https://www.mdanalysis.org/mdanalysis/documentation_pages/analysis/dihedrals.html
>
> Have a nice day, Tamas
>
> On 01/09/2019 10:30 AM, za...@tezu.ernet.in wrote:
>> Dear Users
>>
>> Can anyone suggest me any available tool to analyze ramachandran plot
>> timewise for a trajectory?
>>
>> Thank You
>>
>> Regards
>> Zaved Hazarika
>> Research Scholar
>> Dept. Of Molecular Biology and Biotechnology,
>> Tezpur University,
>> India
>>
>>
>>
>>
>>
>>
>>
>> * * * D I S C L A I M E R * * *
>> This e-mail may contain privileged information and is intended solely
>> for the individual named. If you are not the named addressee you should
>> not disseminate, distribute or copy this e-mail. Please notify the
>> sender immediately by e-mail if you have received this e-mail in error
>> and destroy it from your system. Though considerable effort has been
>> made to deliver error free e-mail messages but it can not be guaranteed
>> to be secure or error-free as information could be intercepted,
>> corrupted, lost, destroyed, delayed, or may contain viruses. The
>> recipient must verify the integrity of this e-mail message.
>>
>
>
> --
> Tamas Hegedus, PhD
> Senior Research Fellow
> Department of Biophysics and Radiation Biology
> Semmelweis University | phone: (36) 1-459 1500/60233
> Tuzolto utca 37-47| mailto:ta...@hegelab.org
> Budapest, 1094, Hungary   | http://www.hegelab.org
>
>
> --


Regards
Zaved Hazarika
Research Scholar
Dept. Of Molecular Biology and Biotechnology,
Tezpur University,
India



* * * D I S C L A I M E R * * *
This e-mail may contain privileged information and is intended solely for the 
individual named. If you are not the named addressee you should not 
disseminate, distribute or copy this e-mail. Please notify the sender 
immediately by e-mail if you have received this e-mail in error and destroy it 
from your system. Though considerable effort has been made to deliver error 
free e-mail messages but it can not be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, delayed, or may 
contain viruses. The recipient must verify the integrity of this e-mail message.
-- 
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.


Re: [gmx-users] ramachandran plot

2019-01-10 Thread zaved
> Message: 5
> Date: Wed, 9 Jan 2019 17:17:31 +0530
> From: Subhomoi Borkotoky 
> To: gmx-us...@gromacs.org
> Subject: Re: [gmx-users] ramachandran plot
> Message-ID:
>   
> Content-Type: text/plain; charset="UTF-8"

Hii Subhomoi

Thank you so much for your suggestion.

Regards
Zaved

> Hi Javed,
>
> I hope *gmx rama* will solve the issue.
>
> http://manual.gromacs.org/archive/5.0.4/programs/gmx-rama.html
>
>
> Thanks & Regards,
> --
> *Subhomoi Borkotoky, Ph. D.*
> DBT Research Associate,
> Kusuma School of Biological Sciences,
> Indian Institute of Technology Delhi,
> New Delhi-110016,
> India.
>
> Alternate E-mail : subho...@yahoo.com
>
>
>
>
>
> On Wed, Jan 9, 2019 at 3:01 PM  wrote:
>
>> Dear Users
>>
>> Can anyone suggest me any available tool to analyze ramachandran plot
>> timewise for a trajectory?
>>
>> Thank You
>>
>> Regards
>> Zaved Hazarika
>> Research Scholar
>> Dept. Of Molecular Biology and Biotechnology,
>> Tezpur University,
>> India


* * * D I S C L A I M E R * * *
This e-mail may contain privileged information and is intended solely for the 
individual named. If you are not the named addressee you should not 
disseminate, distribute or copy this e-mail. Please notify the sender 
immediately by e-mail if you have received this e-mail in error and destroy it 
from your system. Though considerable effort has been made to deliver error 
free e-mail messages but it can not be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, delayed, or may 
contain viruses. The recipient must verify the integrity of this e-mail message.
-- 
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.


Re: [gmx-users] ramachandran plot

2019-01-09 Thread Subhomoi Borkotoky
Hi Javed,

I hope *gmx rama* will solve the issue.

http://manual.gromacs.org/archive/5.0.4/programs/gmx-rama.html


Thanks & Regards,
--
*Subhomoi Borkotoky, Ph. D.*
DBT Research Associate,
Kusuma School of Biological Sciences,
Indian Institute of Technology Delhi,
New Delhi-110016,
India.

Alternate E-mail : subho...@yahoo.com





On Wed, Jan 9, 2019 at 3:01 PM  wrote:

> Dear Users
>
> Can anyone suggest me any available tool to analyze ramachandran plot
> timewise for a trajectory?
>
> Thank You
>
> Regards
> Zaved Hazarika
> Research Scholar
> Dept. Of Molecular Biology and Biotechnology,
> Tezpur University,
> India
>
>
>
>
>
>
>
> * * * D I S C L A I M E R * * *
> This e-mail may contain privileged information and is intended solely for
> the individual named. If you are not the named addressee you should not
> disseminate, distribute or copy this e-mail. Please notify the sender
> immediately by e-mail if you have received this e-mail in error and destroy
> it from your system. Though considerable effort has been made to deliver
> error free e-mail messages but it can not be guaranteed to be secure or
> error-free as information could be intercepted, corrupted, lost, destroyed,
> delayed, or may contain viruses. The recipient must verify the integrity of
> this e-mail message.
> --
> Gromacs Users mailing list
>
> * Please search the archive at
> http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> posting!
>
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> send a mail to gmx-users-requ...@gromacs.org.
>
-- 
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.


Re: [gmx-users] ramachandran plot

2019-01-09 Thread Tamas Hegedus

Hi,

I use the python MDAnalysis packages for this.

https://github.com/MDAnalysis/mdanalysis/issues/1335

https://www.mdanalysis.org/mdanalysis/documentation_pages/analysis/dihedrals.html

Have a nice day, Tamas

On 01/09/2019 10:30 AM, za...@tezu.ernet.in wrote:

Dear Users

Can anyone suggest me any available tool to analyze ramachandran plot
timewise for a trajectory?

Thank You

Regards
Zaved Hazarika
Research Scholar
Dept. Of Molecular Biology and Biotechnology,
Tezpur University,
India







* * * D I S C L A I M E R * * *
This e-mail may contain privileged information and is intended solely for the 
individual named. If you are not the named addressee you should not 
disseminate, distribute or copy this e-mail. Please notify the sender 
immediately by e-mail if you have received this e-mail in error and destroy it 
from your system. Though considerable effort has been made to deliver error 
free e-mail messages but it can not be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, delayed, or may 
contain viruses. The recipient must verify the integrity of this e-mail message.




--
Tamas Hegedus, PhD
Senior Research Fellow
Department of Biophysics and Radiation Biology
Semmelweis University | phone: (36) 1-459 1500/60233
Tuzolto utca 37-47| mailto:ta...@hegelab.org
Budapest, 1094, Hungary   | http://www.hegelab.org
--
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.


[gmx-users] ramachandran plot

2019-01-09 Thread zaved
Dear Users

Can anyone suggest me any available tool to analyze ramachandran plot
timewise for a trajectory?

Thank You

Regards
Zaved Hazarika
Research Scholar
Dept. Of Molecular Biology and Biotechnology,
Tezpur University,
India







* * * D I S C L A I M E R * * *
This e-mail may contain privileged information and is intended solely for the 
individual named. If you are not the named addressee you should not 
disseminate, distribute or copy this e-mail. Please notify the sender 
immediately by e-mail if you have received this e-mail in error and destroy it 
from your system. Though considerable effort has been made to deliver error 
free e-mail messages but it can not be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, delayed, or may 
contain viruses. The recipient must verify the integrity of this e-mail message.
-- 
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.


Re: [gmx-users] Ramachandran plot

2017-06-07 Thread Mark Abraham
Hi,

This is why you should actually copy and paste your command lines so you
don't waste your time ;-) And mine.

Unless you wrote your entire system to your xtc file, your tpr has more
atoms than your xtc, and thus probably some more dihedrals. Make a matching
subset of your tpr using gmx convert-tpr, and use that with gmx rama -s.

Mark

On Wed, Jun 7, 2017 at 10:41 AM RAHUL SURESH 
wrote:

> Dear Mark
> Thank you
>
> gmx rama -f traj.xtc -s topol.tpr -o ramachandran.xvg
>
> This was my command..
>
> I didn't choose any dihedral particularly
>
>
> On Wed, 7 Jun 2017 at 2:00 PM, Mark Abraham 
> wrote:
>
> > Hi,
> >
> > Sounds like your choice of dihedrals doesn't match your system. How did
> you
> > select them?
> >
> > Mark
> >
> > On Wed, 7 Jun 2017 08:41 RAHUL SURESH  wrote:
> >
> > > Dear Users
> > >
> > > When I try to execute ramachandran plot analysis, I get the following
> > note
> > > like "Dihedral around 5809,5816 not found in topology. Using mult=3"
> > > (nearly 30-40 dihedrals). What is it about?
> > >
> > > Input is just protein structure extended upto 150ns.
> > >
> > > --
> > > *Regards,*
> > > *Rahul Suresh*
> > > *Research Scholar*
> > > *Bharathiar University*
> > > *Coimbatore*
> > > --
> > > Gromacs Users mailing list
> > >
> > > * Please search the archive at
> > > http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> > > posting!
> > >
> > > * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> > >
> > > * For (un)subscribe requests visit
> > > https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> > > send a mail to gmx-users-requ...@gromacs.org.
> > >
> > --
> > Gromacs Users mailing list
> >
> > * Please search the archive at
> > http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> > posting!
> >
> > * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> >
> > * For (un)subscribe requests visit
> > https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> > send a mail to gmx-users-requ...@gromacs.org.
> >
> --
> *Regards,*
> *Rahul Suresh*
> *Research Scholar*
> *Bharathiar University*
> *Coimbatore*
> --
> Gromacs Users mailing list
>
> * Please search the archive at
> http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> posting!
>
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> send a mail to gmx-users-requ...@gromacs.org.
>
-- 
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.


Re: [gmx-users] Ramachandran plot

2017-06-07 Thread RAHUL SURESH
Dear Mark
Thank you

gmx rama -f traj.xtc -s topol.tpr -o ramachandran.xvg

This was my command..

I didn't choose any dihedral particularly


On Wed, 7 Jun 2017 at 2:00 PM, Mark Abraham 
wrote:

> Hi,
>
> Sounds like your choice of dihedrals doesn't match your system. How did you
> select them?
>
> Mark
>
> On Wed, 7 Jun 2017 08:41 RAHUL SURESH  wrote:
>
> > Dear Users
> >
> > When I try to execute ramachandran plot analysis, I get the following
> note
> > like "Dihedral around 5809,5816 not found in topology. Using mult=3"
> > (nearly 30-40 dihedrals). What is it about?
> >
> > Input is just protein structure extended upto 150ns.
> >
> > --
> > *Regards,*
> > *Rahul Suresh*
> > *Research Scholar*
> > *Bharathiar University*
> > *Coimbatore*
> > --
> > Gromacs Users mailing list
> >
> > * Please search the archive at
> > http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> > posting!
> >
> > * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> >
> > * For (un)subscribe requests visit
> > https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> > send a mail to gmx-users-requ...@gromacs.org.
> >
> --
> Gromacs Users mailing list
>
> * Please search the archive at
> http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> posting!
>
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> send a mail to gmx-users-requ...@gromacs.org.
>
-- 
*Regards,*
*Rahul Suresh*
*Research Scholar*
*Bharathiar University*
*Coimbatore*
-- 
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.


Re: [gmx-users] Ramachandran plot

2017-06-07 Thread Mark Abraham
Hi,

Sounds like your choice of dihedrals doesn't match your system. How did you
select them?

Mark

On Wed, 7 Jun 2017 08:41 RAHUL SURESH  wrote:

> Dear Users
>
> When I try to execute ramachandran plot analysis, I get the following note
> like "Dihedral around 5809,5816 not found in topology. Using mult=3"
> (nearly 30-40 dihedrals). What is it about?
>
> Input is just protein structure extended upto 150ns.
>
> --
> *Regards,*
> *Rahul Suresh*
> *Research Scholar*
> *Bharathiar University*
> *Coimbatore*
> --
> Gromacs Users mailing list
>
> * Please search the archive at
> http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> posting!
>
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> send a mail to gmx-users-requ...@gromacs.org.
>
-- 
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.


[gmx-users] Ramachandran plot

2017-06-07 Thread RAHUL SURESH
Dear Users

When I try to execute ramachandran plot analysis, I get the following note
like "Dihedral around 5809,5816 not found in topology. Using mult=3"
(nearly 30-40 dihedrals). What is it about?

Input is just protein structure extended upto 150ns.

-- 
*Regards,*
*Rahul Suresh*
*Research Scholar*
*Bharathiar University*
*Coimbatore*
-- 
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.


Re: [gmx-users] ramachandran plot

2014-11-18 Thread Urszula Uciechowska
Hi Tsjerk,

I was wondering how did you get the input.dat file? did you got it from
grace/xmgrace? I was able to save the plot in .ps or .png format file.
However whenever I tried to run kde2d.r I was getting an error:
Please see below:
 ./kde2d.r ramachandran.png ramachandran-2.png
./kde2d.r: line 11: syntax error near unexpected token `('
./kde2d.r: line 11: `args - commandArgs()'

what could be wrong?

best regards
Urszula

 Hi Urszula,

 Save the following as kde2d.r and make it executable. Then you can run

 ./kde2d.r rama.dat rama.png

 Cheers,

 Tsjerk

 kde2d.r

 #!/usr/bin/env Rscript

 # Script for drawing 2D combined linear/circular KDE plots.
 #
 # (c)2014 Tsjerk A. Wassenaar
 # Friedrich-Alexander University of Erlangen-Nuremberg


 args - commandArgs()
 args - args[-(1:match(--args, args))]


 # MASS library is needed for bandwidths
 require(MASS)


 # This 2D circular KDE function was developed for correct handling
 # of bivariate angular data as part of the orientational analysis
 # used with DAFT (Manuscript submitted).
 kde2d - function (x, y, h, n = 25, xlim, ylim, circular=TRUE, phase=0)
 {
 if (length(y) != length(x))
 stop(data vectors must be the same length)

 n- rep(n, length.out = 2L)
 phase- rep(phase, length.out = 2L)
 circular - rep(circular, length.out = 2L)

 s - which(!is.na(x) | !is.na(y))
 x - x[s]
 y - y[s]

 nx - length(x)

 if (any(!is.finite(x)) || any(!is.finite(y)))
 stop(missing or infinite values in the data are not allowed)


 if (circular[1])
 x - (x+180)%%360-180

 if (circular[2])
 y - (y+180)%%360-180


 if (missing(xlim))
 xlim - if (circular[1]) c(-180,180) else range(x)

 if (missing(ylim))
 ylim - if (circular[2]) c(-180,180) else range(y)

 if (any(!is.finite(c(xlim,ylim
 stop(only finite values are allowed in 'xlim' and 'ylim')


 h - if (missing(h))
 c(bandwidth.nrd(x), bandwidth.nrd(y))
 else rep(h, length.out = 2L)
 if (any(h = 0))
 stop(bandwidths must be strictly positive)
 h - h/4


 if (circular[1])
 {
 gx - seq.int(-180, 180, length.out = n[1L])
 ax - ((outer(gx, x-phase[1], -)+180)%%360-180)/h[1L]
 gx - gx + phase[1]
 }
 else
 {
 gx - seq.int(xlim[1], xlim[2], length.out = n[1L])
 ax - outer(gx, x, -)/h[1L]
 }


 if (circular[2])
 {
 gy - seq.int(-180, 180, length.out = n[2L])
 ay - ((outer(gy, y-phase[2], -)+180)%%360-180)/h[2L]
 gy - gy + phase[2]
 }
 else
 {
 gy - seq.int(ylim[1], ylim[2], length.out = n[2L])
 ay - outer(gy, y, -)/h[2L]
 }


 z - tcrossprod(matrix(dnorm(ax), , nx), matrix(dnorm(ay), , nx))/(nx
 *
 h[1L] * h[2L])


 list(x = gx, y = gy, z = z)
 }


 # Color gradients for coloring density plots

 rng   - seq(0,1,length.out=100)

 white2red - rgb(1,rev(rng),rev(rng))
 blue2white- rgb(rng,rng,1)

 # Rainbow
 magenta2red   - rgb(1,0,rev(rng))
 red2yellow- rgb(1,rng,0)
 yellow2green  - rgb(rev(rng),1,0)
 green2cyan- rgb(0,1,rng)
 cyan2blue - rgb(0,rev(rng),1)

 red2orange- rgb(1,0.5*rng,0)
 orange2yellow - rgb(1,0.5+0.5*rng,0)



 data - read.table(args[1])
 d- kde2d(data[,1],data[,2])


 ## Plotting density images

 # Here the density images are prepared and written to file. The first one
 (WT) is explained in detail:

 #---Start of image---

 # Wildtype

 # Start a 1200x1200 png file, with a font size (for labels) of 40 points
 # Changing the resolution requires changing the font size to keep the
 relative size.
 png(
 args[2],
 width=1200,
 height=1200,
 pointsize=40
 )

 # Write an image of the density for WT
 image(
 d$x, d$y, d$z, # Image data X/Y and intensity (Z)
 zlim=c(0,max(d$z)),# Limits for coloring
 xlab=expression(phi),  # X-label text. expression(beta) gives the
 greek
 character
 ylab=expression(psi),  # Y-label text.
 main=,   # Main title. Can be set to  to suppress
 title.
 bty=n,   # Surrounding box type. To draw a thicker box,
 the box is here suppressed, using n for None.
 col=c(white2red,red2orange,orange2yellow)
 )

 box(lwd=3) # Add a box with a thicker line. Change this to
 match the resolution of the imge.
 # Add points
 points(data[,1], data[,2], pch=., cex=1)

 # Add contour lines
 contour(
 d$x, d$y, d$z,
 zlim=c(0,max(d$z)),
 add=TRUE,  # If add=FALSE (default), then 'contour' starts
 a new plot.
 labels=, # Suppress labels on contour lines
 labcex=0.001,  # To avoid gaps in the controu lines (because
 of
 the empty label), set the label size very small
 nlevels=20,# Number of lines to draw, between range of
 'zlim'
 lwd=3  # Width of contour lines. Set to 3 to match png
 

Re: [gmx-users] ramachandran plot

2014-11-17 Thread Urszula Uciechowska
Dear Tsjerk,

Could you send me the script again? as I did not find the attachment in
your previous email.

best regards
Urszula


 Hi Urszula,

 Attached is an R script for drawing 2D circular or combined
 circular/linear
 KDEs. It works as a command line script, taking as arguments a file with
 2-column data, and an output image file name (./kde2d.r input.dat
 output.png). It's pretty easy to adapt to suit your needs, even if you
 don't know R specifically. I wrote the routine for a manuscript we just
 submitted, where the method is explained in some detail, and if you like
 the images and care to use it for publications, I would be obliged if you
 could reference that paper (High-Throughput Simulations of Dimer and
 Trimer Assembly of Membrane Proteins. The DAFT approach.). If you run
 into
 problems or have further questions, please let me know.

 Cheers,

 Tsjerk

 On Fri, Nov 14, 2014 at 4:31 PM, Urszula Uciechowska 
 urszula.uciechow...@biotech.ug.edu.pl wrote:

 Could you please send me the code? It can be on my private email.

 Thanks a lot

 Ursuzla

  Hi Urszula,
 
  It's a while ago that I made that one, and I don't have the code at
 hand.
  But it's a combination of a density plot (kde2d) with the points laid
  over,
  and a polygon to highlight the forbidden region. These days I'm doing
  circular 2D KDEs, whic is more correct. I can send the R code for thay
 if
  you want.
 
  Best,
 
  Tsjerk
  On Nov 14, 2014 12:34 PM, Urszula Uciechowska 
  urszula.uciechow...@biotech.ug.edu.pl wrote:
 
  Dear Gromacs users,
 
  I generated the ramachandran plot and would like to colour it in
 xmgrace
  as it was shown in tutorial:
   http://nmr.chem.uu.nl/~adrien/course/molmod/analysis2.html
 
  Does anyone know how to do it?
 
  Best regards
  Urszula Uciechowska
 
 
 
 
  -
  Ta wiadomość została wysłana z serwera Uniwersytetu Gdańskiego
  http://www.ug.edu.pl/
 
  --
  Gromacs Users mailing list
 
  * Please search the archive at
  http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
  posting!
 
  * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
 
  * For (un)subscribe requests visit
  https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
  send a mail to gmx-users-requ...@gromacs.org.
 
  --
  Gromacs Users mailing list
 
  * Please search the archive at
  http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
  posting!
 
  * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
 
  * For (un)subscribe requests visit
  https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
 send
  a mail to gmx-users-requ...@gromacs.org.
 


 University of Gdansk and Medical Univesity of Gdansk
 Department of Molecular and Cellular Biology
 ul. Kladki 24
 80-822 Gdansk
 Poland


 -
 Ta wiadomość została wysłana z serwera Uniwersytetu Gdańskiego
 http://www.ug.edu.pl/

 --
 Gromacs Users mailing list

 * Please search the archive at
 http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
 posting!

 * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

 * For (un)subscribe requests visit
 https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
 send a mail to gmx-users-requ...@gromacs.org.




 --
 Tsjerk A. Wassenaar, Ph.D.
 --
 Gromacs Users mailing list

 * Please search the archive at
 http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
 posting!

 * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

 * For (un)subscribe requests visit
 https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send
 a mail to gmx-users-requ...@gromacs.org.



University of Gdansk and Medical Univesity of Gdansk
Department of Molecular and Cellular Biology
ul. Kladki 24
80-822 Gdansk
Poland


-
Ta wiadomość została wysłana z serwera Uniwersytetu Gdańskiego
http://www.ug.edu.pl/

-- 
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.


Re: [gmx-users] ramachandran plot

2014-11-17 Thread Tsjerk Wassenaar
Hi Urszula,

Save the following as kde2d.r and make it executable. Then you can run

./kde2d.r rama.dat rama.png

Cheers,

Tsjerk

kde2d.r

#!/usr/bin/env Rscript

# Script for drawing 2D combined linear/circular KDE plots.
#
# (c)2014 Tsjerk A. Wassenaar
# Friedrich-Alexander University of Erlangen-Nuremberg


args - commandArgs()
args - args[-(1:match(--args, args))]


# MASS library is needed for bandwidths
require(MASS)


# This 2D circular KDE function was developed for correct handling
# of bivariate angular data as part of the orientational analysis
# used with DAFT (Manuscript submitted).
kde2d - function (x, y, h, n = 25, xlim, ylim, circular=TRUE, phase=0)
{
if (length(y) != length(x))
stop(data vectors must be the same length)

n- rep(n, length.out = 2L)
phase- rep(phase, length.out = 2L)
circular - rep(circular, length.out = 2L)

s - which(!is.na(x) | !is.na(y))
x - x[s]
y - y[s]

nx - length(x)

if (any(!is.finite(x)) || any(!is.finite(y)))
stop(missing or infinite values in the data are not allowed)


if (circular[1])
x - (x+180)%%360-180

if (circular[2])
y - (y+180)%%360-180


if (missing(xlim))
xlim - if (circular[1]) c(-180,180) else range(x)

if (missing(ylim))
ylim - if (circular[2]) c(-180,180) else range(y)

if (any(!is.finite(c(xlim,ylim
stop(only finite values are allowed in 'xlim' and 'ylim')


h - if (missing(h))
c(bandwidth.nrd(x), bandwidth.nrd(y))
else rep(h, length.out = 2L)
if (any(h = 0))
stop(bandwidths must be strictly positive)
h - h/4


if (circular[1])
{
gx - seq.int(-180, 180, length.out = n[1L])
ax - ((outer(gx, x-phase[1], -)+180)%%360-180)/h[1L]
gx - gx + phase[1]
}
else
{
gx - seq.int(xlim[1], xlim[2], length.out = n[1L])
ax - outer(gx, x, -)/h[1L]
}


if (circular[2])
{
gy - seq.int(-180, 180, length.out = n[2L])
ay - ((outer(gy, y-phase[2], -)+180)%%360-180)/h[2L]
gy - gy + phase[2]
}
else
{
gy - seq.int(ylim[1], ylim[2], length.out = n[2L])
ay - outer(gy, y, -)/h[2L]
}


z - tcrossprod(matrix(dnorm(ax), , nx), matrix(dnorm(ay), , nx))/(nx *
h[1L] * h[2L])


list(x = gx, y = gy, z = z)
}


# Color gradients for coloring density plots

rng   - seq(0,1,length.out=100)

white2red - rgb(1,rev(rng),rev(rng))
blue2white- rgb(rng,rng,1)

# Rainbow
magenta2red   - rgb(1,0,rev(rng))
red2yellow- rgb(1,rng,0)
yellow2green  - rgb(rev(rng),1,0)
green2cyan- rgb(0,1,rng)
cyan2blue - rgb(0,rev(rng),1)

red2orange- rgb(1,0.5*rng,0)
orange2yellow - rgb(1,0.5+0.5*rng,0)



data - read.table(args[1])
d- kde2d(data[,1],data[,2])


## Plotting density images

# Here the density images are prepared and written to file. The first one
(WT) is explained in detail:

#---Start of image---

# Wildtype

# Start a 1200x1200 png file, with a font size (for labels) of 40 points
# Changing the resolution requires changing the font size to keep the
relative size.
png(
args[2],
width=1200,
height=1200,
pointsize=40
)

# Write an image of the density for WT
image(
d$x, d$y, d$z, # Image data X/Y and intensity (Z)
zlim=c(0,max(d$z)),# Limits for coloring
xlab=expression(phi),  # X-label text. expression(beta) gives the greek
character
ylab=expression(psi),  # Y-label text.
main=,   # Main title. Can be set to  to suppress title.
bty=n,   # Surrounding box type. To draw a thicker box,
the box is here suppressed, using n for None.
col=c(white2red,red2orange,orange2yellow)
)

box(lwd=3) # Add a box with a thicker line. Change this to
match the resolution of the imge.
# Add points
points(data[,1], data[,2], pch=., cex=1)

# Add contour lines
contour(
d$x, d$y, d$z,
zlim=c(0,max(d$z)),
add=TRUE,  # If add=FALSE (default), then 'contour' starts
a new plot.
labels=, # Suppress labels on contour lines
labcex=0.001,  # To avoid gaps in the controu lines (because of
the empty label), set the label size very small
nlevels=20,# Number of lines to draw, between range of
'zlim'
lwd=3  # Width of contour lines. Set to 3 to match png
resolution. Change when changing the resolution.
)

# Close the image file, saving it.
dev.off()

#---End of image---




On Mon, Nov 17, 2014 at 1:44 PM, Urszula Uciechowska 
urszula.uciechow...@biotech.ug.edu.pl wrote:

 Dear Tsjerk,

 Could you send me the script again? as I did not find the attachment in
 your previous email.

 best regards
 Urszula


  Hi Urszula,
 
  Attached is an R script for drawing 2D circular or combined
  circular/linear
  KDEs. It works as a command line script, taking as arguments a file with
  2-column data, and an output image file 

[gmx-users] ramachandran plot

2014-11-14 Thread Urszula Uciechowska
Dear Gromacs users,

I generated the ramachandran plot and would like to colour it in xmgrace
as it was shown in tutorial:
 http://nmr.chem.uu.nl/~adrien/course/molmod/analysis2.html

Does anyone know how to do it?

Best regards
Urszula Uciechowska




-
Ta wiadomość została wysłana z serwera Uniwersytetu Gdańskiego
http://www.ug.edu.pl/

-- 
Gromacs Users mailing list

* Please search the archive at 
http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a 
mail to gmx-users-requ...@gromacs.org.