The recipnet-site-utils package includes a graphical utility for creating sample metadata records from existing cif files that you might have. This normally is most useful when you’re first setting your site up and want to import “legacy” data.
TIPè This release of the Reciprocal Net site software contains a web-based function that synchronizes a sample’s metadata against the contents of a cif data file. Use of the web-based tool is recommended in most cases. By contrast, the utility described in the following section is most useful if you have dozens or hundreds of cif’s to be imported in-bulk to your server.
To run the utility, you’ll need to be sitting at your server, be logged in as root, be running an X/Windows session (you might need to type startx at the command line to launch one), and have the cif file(s) sitting someplace in your server’s filesystem. From a command prompt inside an X/Windows terminal, type:
where filename.cif is the path to the first of your cif files that you wish to import.
A window will appear with a list of data blocks found in the cif file in the left pane, a list of parse errors encountered in the cif file in the bottom pane, and import details about one particular data block in the right pane. (Normally a single cif data block will translate directly into one Reciprocal Net sample.) Click on the name of a data block in the left pane. Information extracted from this cif data block will appear in the right pane, as it would be translated to Reciprocal Net sample metadata. You can make any necessary additions to changes to the metadata record if you wish. In particular, you’ll always need to check the Lab, Provider, and Local Sample ID (i.e. sample number) fields – these data items are an integral part of Reciprocal Net’s tracking mechanisms and cannot be changed later. When you’re satisfied with the information in the right pane, hit the Store button to create the metadata record in the database. Reciprocal Net samples created in this way automatically receive the complete state. You may continue importing cif data blocks (if there were more than one in your file) or simply exit the program.
After you’ve created a metadata record for your sample, you’ll probably want to create a data directory in the repository and copy data files for the sample into it. You should use the web application to create a directory in the repository for your sample as was described in the previous section. Then, simply populate the new directory with the sample’s data files (including, possibly, the cif file you just imported) – the site software will detect and activate your data files immediately.
An alternate approach when importing a batch of cif files is to create repository directories first, populate them with cif files (and possibly other data files), and then run the recipnet-cifimporter utility to create the metadata records afterwards. Such an operation can be perilous and you should attempt it only if all of the following conditions are met:
1. Every one of your cif files contains exactly one data block.
2. You already know what sample numbers you plan to assign to each sample (and cif data block).
3. You do not plan to use “grouping directories” in your repository.
4. You feel comfortable manipulating GNU/Linux file and directory permissions.
In this alternate approach, the first step is to create individual repository directories for each cif file that you have. Don’t forget: each directory name must match exactly the sample number you plan to assign later. If the samples all belong to the lab called ‘abc’, then the data directory you create for sample ‘123’ should go in /var/recipnet/data/abc/123/, without any extra grouping directories. Place one cif file in each new repository directory that you created, along with any other data files that you intend to attach to the samples. Now set appropriate permissions on all the new repository directories and files within them using GNU/Linux’s chmod, chown, and chcon commands. Once this is done, go ahead and invoke recipnet-cifimporter. If you like, it is possible to specify several cif files on the command line by separating them with spaces. Create metadata records in this way (as was described earlier) for every cif file that you’re importing. Finally, you need to link the repository directories you created manually to the metadata records you just created. Use the recipnet web application to go to the Edit sample page for each newly-imported sample. Near the bottom of the page, where attached data files normally appear, should be a message that says No holding record. Hit the Create button (without entering anything into the grouping directory box) to link your manually-created repository directory. When the page reloads, the data files you placed in the repository directory should appear. The import process is complete once you’ve done this for each new sample.