IntaRNA 3.4.1
RNA-RNA interaction prediction | C++ API
Loading...
Searching...
No Matches
InteractionEnergyIdxOffset.h
Go to the documentation of this file.
1
2#ifndef INTARNA_INTERACTIONENERGYIDXOFFSET_H_
3#define INTARNA_INTERACTIONENERGYIDXOFFSET_H_
4
6
7namespace IntaRNA {
8
18{
19public:
20
29 , const size_t offset1 = 0
30 , const size_t offset2 = 0 );
31
32
34
39 size_t getOffset1() const;
40
45 void setOffset1(size_t offset1);
46
51 size_t getOffset2() const;
52
57 void setOffset2(size_t offset2);
58
59
76 virtual
77 E_type
78 getE( const size_t i1, const size_t j1
79 , const size_t i2, const size_t j2
80 , const E_type hybridE ) const;
81
89 virtual
90 E_type
91 getE( const Z_type Z ) const;
92
99 virtual
100 bool
101 areComplementary( const size_t i1, const size_t i2 ) const;
102
109 virtual
110 bool
111 isGU( const size_t i1, const size_t i2 ) const;
112
117 virtual
118 size_t
119 size1() const;
120
125 virtual
126 size_t
127 size2() const;
128
138 virtual
139 E_type
140 getED1( const size_t i1, const size_t j1 ) const;
141
152 virtual
153 E_type
154 getED2( const size_t i2, const size_t j2 ) const;
155
164 virtual
165 bool
166 isAccessible1( const size_t i ) const;
167
176 virtual
177 bool
178 isAccessible2( const size_t i ) const;
179
196 virtual
197 E_type
198 getE_multi( const size_t i1, const size_t j1
199 , const size_t i2, const size_t j2
200 , const ES_multi_mode ES_mode ) const;
201
215 virtual
216 E_type
217 getES1( const size_t i1, const size_t j1 ) const;
218
232 virtual
233 E_type
234 getES2( const size_t i2, const size_t j2 ) const;
235
245 virtual
246 E_type
247 getE_multiUnpaired( const size_t numUnpaired ) const;
248
249
263 virtual
264 E_type
265 getE_multiHelix( const size_t j1, const size_t j2 ) const;
266
274 virtual
275 E_type
276 getE_multiClosing() const;
277
283 virtual
284 E_type
285 getE_init( ) const;
286
287
307 virtual
308 E_type
309 getE_interLeft( const size_t i1, const size_t j1, const size_t i2, const size_t j2 ) const;
310
311
324 virtual
325 E_type
326 getE_danglingLeft( const size_t i1, const size_t i2 ) const;
327
328
341 virtual
342 E_type
343 getE_danglingRight( const size_t j1, const size_t j2 ) const;
344
356 virtual
357 E_type
358 getE_endLeft( const size_t i1, const size_t i2 ) const;
359
371 virtual
372 E_type
373 getE_endRight( const size_t j1, const size_t j2 ) const;
374
389 virtual
390 Z_type
391 getPr_danglingLeft( const size_t i1, const size_t j1, const size_t i2, const size_t j2 ) const;
392
407 virtual
408 Z_type
409 getPr_danglingRight( const size_t i1, const size_t j1, const size_t i2, const size_t j2 ) const;
410
411
412
416 virtual
417 Z_type
418 getRT() const;
419
427 virtual
429 getBasePair( const size_t i1, const size_t i2 ) const;
430
431
437 virtual
438 size_t
439 getIndex1( const Interaction::BasePair & bp ) const;
440
441
447 virtual
448 size_t
449 getIndex2( const Interaction::BasePair & bp ) const;
450
451
468 virtual
469 bool
470 isValidInternalLoop( const size_t i1, const size_t j1, const size_t i2, const size_t j2 ) const;
471
477 virtual
478 E_type
479 getEall1() const;
480
486 virtual
487 E_type
488 getEall2() const;
489
490
491protected:
492
495
497 size_t offset1;
498
500 size_t offset2;
501
502};
503
504
505
509
510
511inline
513InteractionEnergyIdxOffset( const InteractionEnergy & energyOriginal
514 , const size_t offset1
515 , const size_t offset2 )
516
517 :
518 InteractionEnergy( energyOriginal )
519 , energyOriginal(energyOriginal)
520 , offset1(offset1)
521 , offset2(offset2)
522{
523#if INTARNA_IN_DEBUG_MODE
524 // input sanity checks
527#endif
528}
529
531
532inline
536
538
539inline
540size_t
542getOffset1() const
543{
544 return offset1;
545}
546
548
549inline
550void
552setOffset1(size_t offset1)
553{
554#if INTARNA_IN_DEBUG_MODE
555 if (offset1 >= energyOriginal.size1()) {
556 throw std::runtime_error("InteractionEnergyIdxOffset : offset1 "+toString(offset1)
557 +" > seq1.length "+toString(energyOriginal.size1()));
558 }
559#endif
560 this->offset1 = offset1;
561}
562
564
565inline
566size_t
568getOffset2() const
569{
570 return offset2;
571}
572
574
575inline
576void
578setOffset2(size_t offset2)
579{
580#if INTARNA_IN_DEBUG_MODE
581 if (offset2 >= energyOriginal.size2()) {
582 throw std::runtime_error("InteractionEnergyIdxOffset : offset2 "+toString(offset2)
583 +" > seq2.length "+toString(energyOriginal.size2()));
584 }
585#endif
586 this->offset2 = offset2;
587}
588
590
591inline
592E_type
594getED1( const size_t i1, const size_t j1 ) const
595{
596 return energyOriginal.getED1( i1+offset1, j1+offset1 );
597}
598
600
601inline
602E_type
604getED2( const size_t i2, const size_t j2 ) const
605{
606 return energyOriginal.getED2( i2+offset2, j2+offset2 );
607}
608
610
611inline
612bool
614isAccessible1( const size_t i ) const
615{
617}
618
620
621inline
622bool
624isAccessible2( const size_t i ) const
625{
627}
628
630
631inline
632bool
634isGU( const size_t i1, const size_t i2 ) const
635{
636 return energyOriginal.isGU( i1+offset1, i2+offset2);
637}
638
640
641inline
642bool
644areComplementary( const size_t i1, const size_t i2 ) const
645{
647}
648
650
651inline
652size_t
658
660
661inline
662size_t
668
670
671inline
672E_type
674getES1( const size_t i1, const size_t j1 ) const
675{
676 return energyOriginal.getES1( i1+offset1, j1+offset1 );
677}
678
680
681inline
682E_type
684getES2( const size_t i2, const size_t j2 ) const
685{
686 return energyOriginal.getES2( i2+offset2, j2+offset2 );
687}
688
690
691inline
692E_type
694getE_multiUnpaired( const size_t numUnpaired ) const
695{
696 return energyOriginal.getE_multiUnpaired( numUnpaired );
697}
698
699
701
702inline
703E_type
705getE_multiHelix( const size_t j1, const size_t j2 ) const
706{
708}
709
711
712inline
713E_type
719
721
722inline
723E_type
729
731
732inline
733E_type
735getE_interLeft( const size_t i1, const size_t j1, const size_t i2, const size_t j2 ) const
736{
738}
739
740
742
743inline
744E_type
746getE_danglingLeft( const size_t i1, const size_t i2 ) const
747{
749}
750
752
753inline
754E_type
756getE_danglingRight( const size_t j1, const size_t j2 ) const
757{
759}
760
762
763inline
764E_type
766getE_endLeft( const size_t i1, const size_t i2 ) const
767{
769}
770
772
773inline
774E_type
776getE_endRight( const size_t j1, const size_t j2 ) const
777{
779}
780
782
783inline
784Z_type
786getPr_danglingLeft( const size_t i1, const size_t j1, const size_t i2, const size_t j2 ) const
787{
789}
790
792
793inline
794Z_type
796getPr_danglingRight( const size_t i1, const size_t j1, const size_t i2, const size_t j2 ) const
797{
799}
800
802
803inline
806getBasePair( const size_t i1, const size_t i2 ) const
807{
808 return energyOriginal.getBasePair( i1+offset1, i2+offset2 );
809}
810
812
813inline
814size_t
816getIndex1( const Interaction::BasePair & bp ) const
817{
818#if INTARNA_IN_DEBUG_MODE
819 if (energyOriginal.getIndex1(bp)<offset1) throw std::runtime_error("InteractionEnergyIdxOffset::getIndex1("+toString(energyOriginal.getIndex1(bp))+") < offset1 = "+toString(offset1));
820#endif
822}
823
825
826inline
827size_t
829getIndex2( const Interaction::BasePair & bp ) const
830{
831#if INTARNA_IN_DEBUG_MODE
832 if (energyOriginal.getIndex2(bp)<offset2) throw std::runtime_error("InteractionEnergyIdxOffset::getIndex2("+toString(energyOriginal.getIndex2(bp))+") < offset2 = "+toString(offset2));
833#endif
835}
836
838
839inline
840Z_type
842getRT() const
843{
844 return energyOriginal.getRT();
845}
846
848
849inline
850E_type
852getE( const Z_type Z ) const
853{
854 return energyOriginal.getE( Z );
855}
856
858
859inline
860E_type
862getE( const size_t i1, const size_t j1
863 , const size_t i2, const size_t j2
864 , const E_type hybridE ) const
865{
866 return energyOriginal.getE( i1+offset1, j1+offset1, i2+offset2, j2+offset2, hybridE );
867}
868
870
871inline
872E_type
874getE_multi( const size_t i1, const size_t j1
875 , const size_t i2, const size_t j2
876 , const ES_multi_mode ES_mode ) const
877{
878 return energyOriginal.getE_multi( i1+offset1, j1+offset1, i2+offset2, j2+offset2, ES_mode );
879}
880
882
883inline
884bool
886isValidInternalLoop( const size_t i1, const size_t j1, const size_t i2, const size_t j2 ) const
887{
889}
890
892
893inline
894E_type
900
902
903inline
904E_type
910
912
913
914} // namespace
915
916
917#endif /* INTERACTIONENERGYIDXOFFSET_H_ */
Definition InteractionEnergyIdxOffset.h:18
virtual E_type getE_multiHelix(const size_t j1, const size_t j2) const
Definition InteractionEnergyIdxOffset.h:705
virtual Interaction::BasePair getBasePair(const size_t i1, const size_t i2) const
Definition InteractionEnergyIdxOffset.h:806
virtual bool areComplementary(const size_t i1, const size_t i2) const
Definition InteractionEnergyIdxOffset.h:644
virtual E_type getE_endRight(const size_t j1, const size_t j2) const
Definition InteractionEnergyIdxOffset.h:776
virtual E_type getEall2() const
Definition InteractionEnergyIdxOffset.h:906
void setOffset1(size_t offset1)
Definition InteractionEnergyIdxOffset.h:552
virtual size_t size2() const
Definition InteractionEnergyIdxOffset.h:664
virtual E_type getE(const size_t i1, const size_t j1, const size_t i2, const size_t j2, const E_type hybridE) const
Definition InteractionEnergyIdxOffset.h:862
virtual E_type getES1(const size_t i1, const size_t j1) const
Definition InteractionEnergyIdxOffset.h:674
virtual E_type getE_multi(const size_t i1, const size_t j1, const size_t i2, const size_t j2, const ES_multi_mode ES_mode) const
Definition InteractionEnergyIdxOffset.h:874
size_t getOffset2() const
Definition InteractionEnergyIdxOffset.h:568
virtual E_type getE_danglingRight(const size_t j1, const size_t j2) const
Definition InteractionEnergyIdxOffset.h:756
virtual Z_type getPr_danglingLeft(const size_t i1, const size_t j1, const size_t i2, const size_t j2) const
Definition InteractionEnergyIdxOffset.h:786
virtual bool isAccessible1(const size_t i) const
Definition InteractionEnergyIdxOffset.h:614
size_t getOffset1() const
Definition InteractionEnergyIdxOffset.h:542
virtual bool isGU(const size_t i1, const size_t i2) const
Definition InteractionEnergyIdxOffset.h:634
virtual bool isAccessible2(const size_t i) const
Definition InteractionEnergyIdxOffset.h:624
virtual ~InteractionEnergyIdxOffset()
Definition InteractionEnergyIdxOffset.h:533
virtual size_t size1() const
Definition InteractionEnergyIdxOffset.h:654
void setOffset2(size_t offset2)
Definition InteractionEnergyIdxOffset.h:578
virtual Z_type getRT() const
Definition InteractionEnergyIdxOffset.h:842
virtual Z_type getPr_danglingRight(const size_t i1, const size_t j1, const size_t i2, const size_t j2) const
Definition InteractionEnergyIdxOffset.h:796
virtual size_t getIndex1(const Interaction::BasePair &bp) const
Definition InteractionEnergyIdxOffset.h:816
size_t offset2
Definition InteractionEnergyIdxOffset.h:500
virtual E_type getEall1() const
Definition InteractionEnergyIdxOffset.h:896
virtual E_type getE_multiUnpaired(const size_t numUnpaired) const
Definition InteractionEnergyIdxOffset.h:694
virtual E_type getE_interLeft(const size_t i1, const size_t j1, const size_t i2, const size_t j2) const
Definition InteractionEnergyIdxOffset.h:735
virtual E_type getE_danglingLeft(const size_t i1, const size_t i2) const
Definition InteractionEnergyIdxOffset.h:746
virtual E_type getED1(const size_t i1, const size_t j1) const
Definition InteractionEnergyIdxOffset.h:594
size_t offset1
Definition InteractionEnergyIdxOffset.h:497
virtual bool isValidInternalLoop(const size_t i1, const size_t j1, const size_t i2, const size_t j2) const
Definition InteractionEnergyIdxOffset.h:886
virtual E_type getE_endLeft(const size_t i1, const size_t i2) const
Definition InteractionEnergyIdxOffset.h:766
virtual E_type getED2(const size_t i2, const size_t j2) const
Definition InteractionEnergyIdxOffset.h:604
virtual E_type getES2(const size_t i2, const size_t j2) const
Definition InteractionEnergyIdxOffset.h:684
virtual size_t getIndex2(const Interaction::BasePair &bp) const
Definition InteractionEnergyIdxOffset.h:829
InteractionEnergyIdxOffset(const InteractionEnergy &energyOriginal, const size_t offset1=0, const size_t offset2=0)
Definition InteractionEnergyIdxOffset.h:513
virtual E_type getE_multiClosing() const
Definition InteractionEnergyIdxOffset.h:715
virtual E_type getE_init() const
Definition InteractionEnergyIdxOffset.h:725
const InteractionEnergy & energyOriginal
Definition InteractionEnergyIdxOffset.h:494
Definition InteractionEnergy.h:20
virtual E_type getE_multiClosing() const =0
virtual E_type getE_endLeft(const size_t i1, const size_t i2) const =0
virtual E_type getE_multi(const size_t i1, const size_t j1, const size_t i2, const size_t j2, const ES_multi_mode ES_mode) const
Definition InteractionEnergy.h:1003
virtual size_t getIndex2(const Interaction::BasePair &bp) const
Definition InteractionEnergy.h:828
virtual E_type getE_multiUnpaired(const size_t numUnpaired) const =0
virtual Z_type getRT() const =0
virtual E_type getEall2() const =0
virtual E_type getE_init() const =0
virtual E_type getE(const size_t i1, const size_t j1, const size_t i2, const size_t j2, const E_type hybridE) const
Definition InteractionEnergy.h:957
virtual Z_type getPr_danglingRight(const size_t i1, const size_t j1, const size_t i2, const size_t j2) const
Definition InteractionEnergy.h:920
virtual size_t getIndex1(const Interaction::BasePair &bp) const
Definition InteractionEnergy.h:818
virtual bool isAccessible2(const size_t i) const
Definition InteractionEnergy.h:871
virtual E_type getE_interLeft(const size_t i1, const size_t j1, const size_t i2, const size_t j2) const =0
virtual bool isAccessible1(const size_t i) const
Definition InteractionEnergy.h:858
virtual E_type getE_danglingLeft(const size_t i1, const size_t i2) const =0
virtual bool areComplementary(const size_t i1, const size_t i2) const
Definition InteractionEnergy.h:687
virtual E_type getE_endRight(const size_t j1, const size_t j2) const =0
virtual E_type getE_multiHelix(const size_t j1, const size_t j2) const =0
virtual E_type getES2(const size_t i2, const size_t j2) const =0
virtual bool isValidInternalLoop(const size_t i1, const size_t j1, const size_t i2, const size_t j2) const
Definition InteractionEnergy.h:729
virtual size_t size1() const
Definition InteractionEnergy.h:709
virtual E_type getED1(const size_t i1, const size_t j1) const
Definition InteractionEnergy.h:838
virtual E_type getEall1() const =0
virtual Interaction::BasePair getBasePair(const size_t i1, const size_t i2) const
Definition InteractionEnergy.h:808
virtual E_type getES1(const size_t i1, const size_t j1) const =0
virtual Z_type getPr_danglingLeft(const size_t i1, const size_t j1, const size_t i2, const size_t j2) const
Definition InteractionEnergy.h:883
virtual size_t size2() const
Definition InteractionEnergy.h:719
virtual bool isGU(const size_t i1, const size_t i2) const
Definition InteractionEnergy.h:699
virtual E_type getE_danglingRight(const size_t j1, const size_t j2) const =0
ES_multi_mode
Definition InteractionEnergy.h:28
virtual E_type getED2(const size_t i2, const size_t j2) const
Definition InteractionEnergy.h:848
type of a base pair index encoding
Definition Interaction.h:33
#define toString(x)
Definition general.h:60
Definition Accessibility.h:13
int E_type
type for energy values (energy + accessibility [ED]) (internally)
Definition general.h:78
double Z_type
type for probabilities, RT and Boltzmann values
Definition general.h:88