> For the complete documentation index, see [llms.txt](https://clinical-genomics.gitbook.io/project-mip/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://clinical-genomics.gitbook.io/project-mip/develop/documentation/api/sample_info.md).

# Sample info

**Version: 1.0.0**

The metadata on the case and samples are recorded in a yaml outfile format with the following data structure and keys:

```
analysis_date: string
case: string
mip_version: string
  path: string,
},
[VCF_FILE_KEY]: {  #Hash of hashes
  clinical: {  
    path: string,
  },
  research: {  
    path: string,
  },
},
recipe: { #Hash of hashes
    outdirectory: string,
    outfile: string,
    path: string,
    version: string,
    metafile_tag: {  
      directory: string,
      file: string,
      path: string,
      processed_by: string,
      version: string,
    },
  },
},
sample: { #Hash of hashes
    analysis_type: string
    [METAFILE_TAG]: {  
      path: string,
    },
    recipe: {
      [RECIPE_NAME]: {
        outdirectory: string,
        outfile: string,
        path: string,
        version: string,
        metafile_tag: {
          directory: string,
          file: string,
          path: string,
          processed_by: string,
          version: string,
        },
        [INFILE]: {
          outdirectory: string,
          outfile: string,
          path: string,
          version: string,
          metafile_tag: {  
            directory: string,
            file: string,
            path: string,
            processed_by: string,
            version: string,
          },
        },
      },
    },
  },
},
```

## Methods

get\_family\_member\_id: Return hash with family member ids

```perl
my %family_member_id = get_family_member_id(
    {
        sample_info_href => $sample_info_href,
    }
);
$family_member_id{children} = [<child1_id>, <child2_id>];
$family_member_id{father} = <father_id>;
$family_member_id{mother} = <mother_id>;
```

get\_pedigree\_sample\_id\_attributes: Return the value of for a supplied sample id with a given attribute (e.g. 'sex')

```perl
my $sample_id_sex = get_pedigree_sample_id_attributes({ attribute => q{sex},
                            sample_id => $sample_id,
                            sample_info_href => $sample_info_href,
                              });
```

get\_read\_group: Return hash with read group headers.

```perl
my %read_group = get_read_group(
            {
                infile_prefix    => $infile_prefix,
                platform         => $active_parameter_href->{platform},
                sample_id        => $sample_id,
                sample_info_href => $sample_info_href,
            }
        );
$rg{id} = <$infile_prefix>;
$rg{pu} = <flowcell>.<lane>.<sample_barcode>;
$rg{sm} = <$sample_id>;
$rg{pl} = <$platform>;
$rg{lb} = <$sample_id>; # Dummy value since the actual LB isn't available in MIP (yet)
```

get\_sample\_info\_case\_recipe\_attributes: Return case recipe attribute or attributes hash

```perl
# Scalar
my $path = get_sample_info_case_recipe_attributes(
    {
        attribute        => q{path},
        recipe_name      => $recipe_name,
        sample_info_href => \%sample_info,
    }
);
$path = <string>;

# Hash
my %attribute = get_sample_info_case_recipe_attributes(
    {
        recipe_name      => $recipe_name,
        sample_info_href => \%sample_info,
    }
);
$attribute{path} = <string>;
```

get\_sample\_info\_sample\_recipe\_attributes: Return sample recipe attribute or attributes hash for infile key

```perl
# Scalar
my $path = get_sample_info_sample_recipe_attributes(
    {
        attribute        => q{path},
        infile => $infile,
        recipe_name      => $recipe_name,
        sample_id => $sample_id,
        sample_info_href => \%sample_info,
    }
);
$path = <string>;

# Hash
my %attribute = get_sample_info_sample_recipe_attributes(
    {
        infile => $infile,
        recipe_name      => $recipe_name,
        sample_id => $sample_id,
        sample_info_href => \%sample_info,
    }
);
$attribute{path} = <string>;
```

set\_file\_path\_to\_store: Set file path under store according to file type and file\_tag

```perl
set_file_path_to_store(
    {
        file_tag         => $file_tag,
        file_type        => $file_type,
        path             => $path,
        sample_info_href => \%sample_info,
    }
);
%sample_info = ( store => { $file_type => { $file_tag => $path, }, } );
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://clinical-genomics.gitbook.io/project-mip/develop/documentation/api/sample_info.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
