NMRLipids / MATCH

GNU General Public License v2.0
4 stars 14 forks source link

Form factor bulk electron density: Calculation from the sum of all components #87

Closed markussmiettinen closed 4 years ago

markussmiettinen commented 4 years ago

Fixed a bug that causes the script to fail, because of a missing file name.

Previous version tried using electronDENSITYsol.xvg, which however was not created by the script.

This fix uses electronDENSITY.xvg, that is, the electron density containing contributions from all molecular components.

It should be fine to use this instead of just the water density (as was done before), because far from the bilayer (i.e. in the bulk) the total density will equal the density of water plus possible soluble molecules such as ions—which is what I understand is referred to as 'solvent' by for example Kucerka et al. and Ollila & Pabst.

Example of the failing of the original script:

localhost:POPCandCLinCHARMM36 bb$ pwd
MATCH/scratch/scriptsbyhsantila/testSystems/POPCandCLinCHARMM36
localhost:POPCandCLinCHARMM36 bb$ ../../center_n_calcFF.sh mappingMolecules.txt PC_CL.tpr short.xtc out.xtc

Mapping: mappingMolecules.txt
TPR in:  PC_CL.tpr
XTC in:  short.xtc
XTC out: out.xtc

Will now CENTER trajectory short.xtc to out.xtc.

Making molecules whole...
Selected 0: 'System'
Reading frame       0 time    0.000   
Reading frame      20 time  400.000    ->  frame     20 time  400.000      

The name of the CH3 carbon in sn-1 chain: C316
The atom number of the last lipid's CH3:  22917
Centering molecules around atom 22917...
Selected 7: 'centralAtom'
Selected 0: 'System'

The name of the g3 carbon(s) in POPC: C1
No g3 carbons in TIP3.
The name of the g3 carbon(s) in TOCL2: C31 C11
No g3 carbons in SOD.
Centering around the center of mass of index group g3carbons...
Selected 8: 'g3carbons'
Selected 0: 'System'
Centering done

Calculating density profiles...
rm: electronDENSITY.xvg: No such file or directory
- POPC -
The groups selected for centering and for density calculation:
Selected 8: 'g3carbons'
Selected 3: 'POPC'
- TIP3 -
The groups selected for centering and for density calculation:
Selected 8: 'g3carbons'
Selected 4: 'TIP3'
- TOCL2 -
The groups selected for centering and for density calculation:
Selected 8: 'g3carbons'
Selected 2: 'TOCL2'
- SOD -
The groups selected for centering and for density calculation:
Selected 8: 'g3carbons'
Selected 5: 'SOD'

Calculating form factor...
head: electronDENSITYsol.xvg: No such file or directory
tail: electronDENSITYsol.xvg: No such file or directory
awk: fatal: cannot open file `electronDENSITYsol.xvg' for reading: No such file or directory
awk: cmd. line:2: bulkDENS=
awk: cmd. line:2:          ^ unexpected newline or end of string
localhost:POPCandCLinCHARMM36 bb$

Example run of the fixed script:

localhost:POPCandCLinCHARMM36 bb$ ../../center_n_calcFF.sh mappingMolecules.txt PC_CL.tpr short.xtc out.xtc

Mapping: mappingMolecules.txt
TPR in:  PC_CL.tpr
XTC in:  short.xtc
XTC out: out.xtc

Will now CENTER trajectory short.xtc to out.xtc.

Making molecules whole...
Selected 0: 'System'
Reading frame       0 time    0.000   
Reading frame      20 time  400.000    ->  frame     20 time  400.000      

The name of the CH3 carbon in sn-1 chain: C316
The atom number of the last lipid's CH3:  22917
Centering molecules around atom 22917...
Selected 7: 'centralAtom'
Selected 0: 'System'

The name of the g3 carbon(s) in POPC: C1
No g3 carbons in TIP3.
The name of the g3 carbon(s) in TOCL2: C31 C11
No g3 carbons in SOD.
Centering around the center of mass of index group g3carbons...
Selected 8: 'g3carbons'
Selected 0: 'System'
Centering done

Calculating density profiles...
rm: electronDENSITY.xvg: No such file or directory
- POPC -
The groups selected for centering and for density calculation:
Selected 8: 'g3carbons'
Selected 3: 'POPC'
- TIP3 -
The groups selected for centering and for density calculation:
Selected 8: 'g3carbons'
Selected 4: 'TIP3'
- TOCL2 -
The groups selected for centering and for density calculation:
Selected 8: 'g3carbons'
Selected 2: 'TOCL2'
- SOD -
The groups selected for centering and for density calculation:
Selected 8: 'g3carbons'
Selected 5: 'SOD'

Calculating form factor...
localhost:POPCandCLinCHARMM36 bb$

Note. Also fixed the small typo (missing space) that caused this error:

awk: cmd. line:2: bulkDENS=
awk: cmd. line:2:          ^ unexpected newline or end of string