Clover icon

Coverage Report

  1. Project Clover database Wed Dec 3 2025 17:03:17 GMT
  2. Package jalview.schemes

File HmmerGlobalBackground.java

 

Coverage histogram

../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

2
7
6
1
73
41
7
1
1.17
6
1.17

Classes

Class Line # Actions
HmmerGlobalBackground 13 7 7
1.0100%
 

Contributing tests

This file is covered by 195 tests. .

Source view

1    package jalview.schemes;
2   
3    import jalview.api.AlignViewportI;
4    import jalview.datamodel.AnnotatedCollectionI;
5    import jalview.datamodel.SequenceCollectionI;
6   
7    /**
8    * An HMM colour scheme that uses global ('Uniprot') background frequencies for
9    * residues
10    *
11    * @author tzvanaalten
12    */
 
13    public class HmmerGlobalBackground extends HmmerColourScheme
14    {
15    /*
16    * The highest possible log ratio is when match emission probability in
17    * the HMM model is 1, and background (for W) is 0.0109 giving
18    * log(1/0.0109) = log(91.743) = 4.519
19    */
20    private static final float MAX_LOG_RATIO = 4.519f;
21   
22    /**
23    * Constructor given a sequence collection
24    *
25    * @param ac
26    */
 
27  2 toggle public HmmerGlobalBackground(SequenceCollectionI ac)
28    {
29  2 super(ac.getHmmSequences());
30  2 String alphabetType = getHmm() == null
31    ? ResidueProperties.ALPHABET_AMINO
32    : getHmm().getAlphabetType();
33  2 setFrequencies(
34    ResidueProperties.backgroundFrequencies.get(alphabetType));
35    }
36   
37    /**
38    * Default constructor (required by ColourSchemes.loadColourSchemes)
39    */
 
40  54 toggle public HmmerGlobalBackground()
41    {
42    }
43   
 
44  618 toggle @Override
45    public String getSchemeName()
46    {
47  618 return JalviewColourScheme.HMMERU.toString();
48    }
49   
 
50  1 toggle @Override
51    protected HmmerColourScheme newInstance(AnnotatedCollectionI ac)
52    {
53  1 return new HmmerGlobalBackground(ac);
54    }
55   
 
56  2 toggle @Override
57    float getMaxInformationScore()
58    {
59  2 return MAX_LOG_RATIO;
60    }
61   
62    /**
63    * Answers a new colour scheme instance based on the HMM of the first sequence
64    * in alignment that has an HMM
65    */
 
66  1 toggle @Override
67    public ColourSchemeI getInstance(AlignViewportI viewport,
68    AnnotatedCollectionI ac)
69    {
70  1 return newInstance(ac);
71    }
72   
73    }