Hi Eleanor,

This is how you would do something similar in gemmi with ccp4-python:

import gemmi

mtz = gemmi.read_mtz_file("input.mtz")
dataset = mtz.add_dataset("mydataset")
dataset.crystal_name = "mycrystal"
dataset.project_name = "myproject"
dataset.wavelength = 1.44555
for column in mtz.columns:
    column.dataset_id = dataset.id
mtz.write_to_file("output.mtz")

Cheers,
Paul


On Tue, 5 Apr 2022 at 15:30, Eleanor Dodson <
[email protected]> wrote:

> Thank you Robbie..
> And good old CAD  fixed it from ccp4i too
>
>  Data line--- labin file_number 1     E1 = I_detw     E2 = SIGI_detw
>  Data line--- xname file_number 1     E1 = Petr     E2 = Petr
>  Data line--- dname file_number 1     E1 = detw1     E2 = detw1
>  Data line--- dpname file_number 1 Petr detw1 twinmap
>  Data line--- dcell file_number 1     Petr detw1 63.157 63.352 118.253
> 90.0 90.0 90.0
>  Data line--- dwave file_number 1 Petr detw1 1.44555
>  Comment line--- ## This script run with the command   ##########
>  Comment line--- # /Applications/ccp4-8.0/bin/cad HKLIN1
> "/Users/eleanor/CCP4I2_PROJECTS/twinmap/detwin_job1-IMEANa.mtz" HKLOUT
> "/Users/eleanor/CCP4I2_PROJECTS/EdTaylor/detwin_job1-IMEANa_editdname1.mtz"
>
> On Tue, 5 Apr 2022 at 15:16, Robbie Joosten <[email protected]>
> wrote:
>
>> Hi Eleanor,
>>
>> I actually add the wavelength to an mtz file with CAD:
>>
>>   cad \
>>   HKLIN1 $WORKDIR/raw_nowavel.mtz \
>>   HKLOUT $WORKDIR/raw.mtz \
>> <<eof >> $WORKDIR/mtz_creation.log
>>     LABIN FILE 1  ALLIN
>>     DWAVELENGTH FILE_NUMBER 1 1 $WAVELENGTH
>>     END
>> eof
>>
>> I have no experience adding dataset names as these are inherited from the
>> mmCIF reflection files I use.
>>
>> Cheers,
>> Robbie
>>
>> > -----Original Message-----
>> > From: CCP4 bulletin board <[email protected]> On Behalf Of Eleanor
>> > Dodson
>> > Sent: Tuesday, April 5, 2022 15:47
>> > To: [email protected]
>> > Subject: [ccp4bb] sftools
>> >
>> >
>> >
>> > Does ANYONE know how to use this useful but ultra-frustrating program??
>> >
>> > I have an mtz file which lacks WAVElength AND Dataset name.
>> >
>> > I try to follow the sftools documentation, and get an output file which
>> -
>> >  lacks WAVElength AND Dataset name.
>> >
>> >
>> > Grrrr
>> >
>> >
>> > sftools <<eof
>> >
>> > READ "detwin_job1-IMEANa.mtz" mtz
>> > SET DWAVE 1.2 WAVElength AND Dataset name.
>> > write "detwin_job1-IMEANab.mtz" mtz
>> > EXIT
>> > YES
>> > eof
>> >
>> >
>> > ________________________________
>> >
>> >
>> > To unsubscribe from the CCP4BB list, click the following link:
>> > https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=CCP4BB&A=1
>>
>>
> ------------------------------
>
> To unsubscribe from the CCP4BB list, click the following link:
> https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=CCP4BB&A=1
>

########################################################################

To unsubscribe from the CCP4BB list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/WA-JISC.exe?SUBED1=CCP4BB&A=1

This message was issued to members of www.jiscmail.ac.uk/CCP4BB, a mailing list 
hosted by www.jiscmail.ac.uk, terms & conditions are available at 
https://www.jiscmail.ac.uk/policyandsecurity/

Reply via email to